diff --git a/src/main/java/com/lz/common/utils/DingTalkUtil.java b/src/main/java/com/lz/common/utils/DingTalkUtil.java index 9e8e32df..008c3c1a 100644 --- a/src/main/java/com/lz/common/utils/DingTalkUtil.java +++ b/src/main/java/com/lz/common/utils/DingTalkUtil.java @@ -11,6 +11,8 @@ import com.lz.modules.app.entity.StaffEntity; import com.lz.modules.app.service.StaffService; import com.lz.modules.job.model.responseBo.DepartmentInfosBo; import com.lz.modules.job.model.responseBo.DepartmentStaffBo; +import com.lz.modules.luck.entity.LuckRecord; +import com.lz.modules.luck.service.LuckRecordService; import com.lz.modules.sys.entity.SysUserEntity; import com.lz.modules.sys.service.SysUserTokenService; import com.lz.modules.third.entity.ThirdAppConfig; @@ -69,6 +71,9 @@ public class DingTalkUtil { @Autowired StaffService staffService; + @Autowired + LuckRecordService luckRecordService; + @Autowired private SysUserTokenService sysUserTokenService; @@ -354,4 +359,40 @@ public class DingTalkUtil { } } + + public R luck(String code, String token, Long luckId) { + try { + DingTalkClient client = new DefaultDingTalkClient("https://oapi.dingtalk.com/user/getuserinfo"); + OapiUserGetuserinfoRequest req = new OapiUserGetuserinfoRequest(); + req.setCode(code); + req.setHttpMethod("GET"); + OapiUserGetuserinfoResponse rsp = client.execute(req, token); + JSONObject json = JSONObject.parseObject(rsp.getBody()); + if(json.getIntValue("errcode") == 0){ + String employeeId = json.getString("userid"); + StaffEntity staffEntity = staffService.selectStaffByEmployeeId(employeeId); + if(staffEntity != null){ + LuckRecord luckRecord = luckRecordService.selectLuckRecordByLuckIdAndStaffId(luckId, staffEntity.getId()); + if(luckRecord == null){//插入抽奖记录 + luckRecord = new LuckRecord(); + luckRecord.setStaffId(staffEntity.getId()); + luckRecord.setLuckId(luckId); + luckRecord.setName(staffEntity.getName()); + luckRecordService.insertLuckRecord(luckRecord); + } + + //登录操作 + + return R.ok(); + } + return R.error("用户不存在"); + } + return R.error("请求钉钉异常:" + json.getString("errmsg")); + + } catch (ApiException e) { + e.printStackTrace(); + return R.error(e.getErrMsg()); + } + + } } diff --git a/src/main/java/com/lz/config/ShiroConfig.java b/src/main/java/com/lz/config/ShiroConfig.java index 0216c28c..19a8dd28 100644 --- a/src/main/java/com/lz/config/ShiroConfig.java +++ b/src/main/java/com/lz/config/ShiroConfig.java @@ -63,6 +63,8 @@ public class ShiroConfig { filterMap.put("/captcha.jpg", "anon"); filterMap.put("/aaa.txt", "anon"); filterMap.put("/dtlg/login", "anon"); + filterMap.put("/dtlg/luck", "anon"); + filterMap.put("/dtlg/look", "anon"); filterMap.put("/**", "oauth2"); shiroFilter.setFilterChainDefinitionMap(filterMap); diff --git a/src/main/java/com/lz/modules/job/business/DingtalkBusiness.java b/src/main/java/com/lz/modules/job/business/DingtalkBusiness.java index ad00a43d..d344a3fd 100644 --- a/src/main/java/com/lz/modules/job/business/DingtalkBusiness.java +++ b/src/main/java/com/lz/modules/job/business/DingtalkBusiness.java @@ -204,4 +204,12 @@ public class DingtalkBusiness { } return R.error("授权失败,未授权"); } + + public R luck(String code, String appid, Long luckId) { + String token = dingTalkUtil.getAccessToken(appid); + if(token != null && token.length() > 0){ + return dingTalkUtil.luck(code, token, luckId); + } + return R.error("授权失败,未授权"); + } } diff --git a/src/main/java/com/lz/modules/luck/controller/LuckController.java b/src/main/java/com/lz/modules/luck/controller/LuckController.java new file mode 100644 index 00000000..aec0be48 --- /dev/null +++ b/src/main/java/com/lz/modules/luck/controller/LuckController.java @@ -0,0 +1,60 @@ +package com.lz.modules.luck.controller; + + +import com.alibaba.fastjson.JSONObject; +import com.lz.common.utils.PageUtils; +import com.lz.common.utils.R; +import com.lz.common.utils.StringUtil; +import com.lz.modules.luck.entity.Luck; +import com.lz.modules.luck.service.LuckService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.HashMap; +import java.util.Map; + +@RestController +@RequestMapping("/luck") +public class LuckController { + + + @Autowired + private LuckService luckService; + + + @RequestMapping("/list") + public R list(@RequestBody String body) { + + return R.ok(); + } + + + @RequestMapping("/getById") + public R getById(@RequestBody Luck luck) { + luck = luckService.selectLuckById(luck.getId()); + return R.ok().put("luck",luck); + } + + + @RequestMapping("/update") + public R update(@RequestBody Luck luck) { + luckService.updateLuckById(luck); + return R.ok(); + } + + + @RequestMapping("/save") + public R save(@RequestBody Luck luck) { + luckService.insertLuck(luck); + return R.ok(); + } + + + @RequestMapping("/delete") + public R list(@RequestBody Long id) { + luckService.deleteLuckById(id); + return R.ok(); + } +} diff --git a/src/main/java/com/lz/modules/luck/controller/LuckGoodsController.java b/src/main/java/com/lz/modules/luck/controller/LuckGoodsController.java new file mode 100644 index 00000000..737c4d26 --- /dev/null +++ b/src/main/java/com/lz/modules/luck/controller/LuckGoodsController.java @@ -0,0 +1,59 @@ +package com.lz.modules.luck.controller; + + +import com.alibaba.fastjson.JSONObject; +import com.lz.common.utils.PageUtils; +import com.lz.common.utils.R; +import com.lz.common.utils.StringUtil; +import com.lz.modules.luck.entity.LuckGoods; +import com.lz.modules.luck.service.LuckGoodsService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.HashMap; +import java.util.Map; + +@RestController +@RequestMapping("/luckGoods") +public class LuckGoodsController { + + + @Autowired + private LuckGoodsService luckGoodsService; + + + @RequestMapping("/list") + public R list(@RequestBody String body) { + return R.ok(); + } + + + @RequestMapping("/getById") + public R getById(@RequestBody LuckGoods luckGoods) { + luckGoods = luckGoodsService.selectLuckGoodsById(luckGoods.getId()); + return R.ok().put("luckGoods",luckGoods); + } + + + @RequestMapping("/update") + public R update(@RequestBody LuckGoods luckGoods) { + luckGoodsService.updateLuckGoodsById(luckGoods); + return R.ok(); + } + + + @RequestMapping("/save") + public R save(@RequestBody LuckGoods luckGoods) { + luckGoodsService.insertLuckGoods(luckGoods); + return R.ok(); + } + + + @RequestMapping("/delete") + public R list(@RequestBody Long id) { + luckGoodsService.deleteLuckGoodsById(id); + return R.ok(); + } +} diff --git a/src/main/java/com/lz/modules/luck/controller/LuckRecordController.java b/src/main/java/com/lz/modules/luck/controller/LuckRecordController.java new file mode 100644 index 00000000..162f61ef --- /dev/null +++ b/src/main/java/com/lz/modules/luck/controller/LuckRecordController.java @@ -0,0 +1,59 @@ +package com.lz.modules.luck.controller; + + +import com.alibaba.fastjson.JSONObject; +import com.lz.common.utils.PageUtils; +import com.lz.common.utils.R; +import com.lz.common.utils.StringUtil; +import com.lz.modules.luck.entity.LuckRecord; +import com.lz.modules.luck.service.LuckRecordService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.HashMap; +import java.util.Map; + +@RestController +@RequestMapping("/luckRecord") +public class LuckRecordController { + + + @Autowired + private LuckRecordService luckRecordService; + + + @RequestMapping("/list") + public R list(@RequestBody String body) { + return R.ok(); + } + + + @RequestMapping("/getById") + public R getById(@RequestBody LuckRecord luckRecord) { + luckRecord = luckRecordService.selectLuckRecordById(luckRecord.getId()); + return R.ok().put("luckRecord",luckRecord); + } + + + @RequestMapping("/update") + public R update(@RequestBody LuckRecord luckRecord) { + luckRecordService.updateLuckRecordById(luckRecord); + return R.ok(); + } + + + @RequestMapping("/save") + public R save(@RequestBody LuckRecord luckRecord) { + luckRecordService.insertLuckRecord(luckRecord); + return R.ok(); + } + + + @RequestMapping("/delete") + public R list(@RequestBody Long id) { + luckRecordService.deleteLuckRecordById(id); + return R.ok(); + } +} diff --git a/src/main/java/com/lz/modules/luck/dao/LuckGoodsMapper.java b/src/main/java/com/lz/modules/luck/dao/LuckGoodsMapper.java new file mode 100644 index 00000000..918b10a7 --- /dev/null +++ b/src/main/java/com/lz/modules/luck/dao/LuckGoodsMapper.java @@ -0,0 +1,33 @@ +package com.lz.modules.luck.dao; +/** +*
+* 奖品表 服务类 +*
+* +* @author quyixiao +* @since 2020-08-21 +*/ +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.lz.modules.luck.entity.LuckGoods; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +@Mapper +public interface LuckGoodsMapper extends BaseMapper+* 活动名称表 服务类 +*
+* +* @author quyixiao +* @since 2020-08-21 +*/ +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.lz.modules.luck.entity.Luck; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +@Mapper +public interface LuckMapper extends BaseMapper+* 中奖记录 服务类 +*
+* +* @author quyixiao +* @since 2020-08-21 +*/ +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.lz.modules.luck.entity.LuckRecord; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +@Mapper +public interface LuckRecordMapper extends BaseMapper+* 菜单权限表 +*
*活动名称表 +* @author quyixiao +* @since 2020-08-21 +*/ + +@Data +@TableName("luck") +public class Luck implements java.io.Serializable { + //活动ID + @TableId(value = "id", type = IdType.AUTO) + private Long id; + //是否删除 + private Integer isDelete; + // + private Date gmtCreate; + // + private Date gmtModified; + //活动名称 + private String name; + //奖品数量 + private Integer goodsCount; + //备注 + private String remark; + //是否结束0为结束 1结束(抽完奖设置为结束) + private Integer finish; + //结束时间 + private Date stopTime; + //开始时间 + private Date startTime; + /** + * 活动ID + * @return + */ + public Long getId() { + return id; + } + /** + * 活动ID + * @param id + */ + public void setId(Long id) { + this.id = id; + } + + /** + * 是否删除 + * @return + */ + public Integer getIsDelete() { + return isDelete; + } + /** + * 是否删除 + * @param isDelete + */ + public void setIsDelete(Integer isDelete) { + this.isDelete = isDelete; + } + + /** + * + * @return + */ + public Date getGmtCreate() { + return gmtCreate; + } + /** + * + * @param gmtCreate + */ + public void setGmtCreate(Date gmtCreate) { + this.gmtCreate = gmtCreate; + } + + /** + * + * @return + */ + public Date getGmtModified() { + return gmtModified; + } + /** + * + * @param gmtModified + */ + public void setGmtModified(Date gmtModified) { + this.gmtModified = gmtModified; + } + + /** + * 活动名称 + * @return + */ + public String getName() { + return name; + } + /** + * 活动名称 + * @param name + */ + public void setName(String name) { + this.name = name; + } + + /** + * 奖品数量 + * @return + */ + public Integer getGoodsCount() { + return goodsCount; + } + /** + * 奖品数量 + * @param goodsCount + */ + public void setGoodsCount(Integer goodsCount) { + this.goodsCount = goodsCount; + } + + /** + * 备注 + * @return + */ + public String getRemark() { + return remark; + } + /** + * 备注 + * @param remark + */ + public void setRemark(String remark) { + this.remark = remark; + } + + /** + * 是否结束0为结束 1结束(抽完奖设置为结束) + * @return + */ + public Integer getFinish() { + return finish; + } + /** + * 是否结束0为结束 1结束(抽完奖设置为结束) + * @param finish + */ + public void setFinish(Integer finish) { + this.finish = finish; + } + + /** + * 结束时间 + * @return + */ + public Date getStopTime() { + return stopTime; + } + /** + * 结束时间 + * @param stopTime + */ + public void setStopTime(Date stopTime) { + this.stopTime = stopTime; + } + + /** + * 开始时间 + * @return + */ + public Date getStartTime() { + return startTime; + } + /** + * 开始时间 + * @param startTime + */ + public void setStartTime(Date startTime) { + this.startTime = startTime; + } + + @Override + public String toString() { + return "Luck{" + + ",id=" + id + + ",isDelete=" + isDelete + + ",gmtCreate=" + gmtCreate + + ",gmtModified=" + gmtModified + + ",name=" + name + + ",goodsCount=" + goodsCount + + ",remark=" + remark + + ",finish=" + finish + + ",stopTime=" + stopTime + + ",startTime=" + startTime + + "}"; + } +} \ No newline at end of file diff --git a/src/main/java/com/lz/modules/luck/entity/LuckGoods.java b/src/main/java/com/lz/modules/luck/entity/LuckGoods.java new file mode 100644 index 00000000..26399e8d --- /dev/null +++ b/src/main/java/com/lz/modules/luck/entity/LuckGoods.java @@ -0,0 +1,186 @@ +package com.lz.modules.luck.entity; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import java.util.Date; +/** +*+* 菜单权限表 +*
*奖品表 +* @author quyixiao +* @since 2020-08-21 +*/ + +@Data +@TableName("luck_goods") +public class LuckGoods implements java.io.Serializable { + // + @TableId(value = "id", type = IdType.AUTO) + private Long id; + // + private Integer isDelete; + // + private Date gmtCreate; + // + private Date gmtModified; + //活动ID + private Long luckId; + //奖品名称 + private String name; + //权重 + private Integer weight; + //备注 + private String remark; + //数量 + private Integer counts; + /** + * + * @return + */ + public Long getId() { + return id; + } + /** + * + * @param id + */ + public void setId(Long id) { + this.id = id; + } + + /** + * + * @return + */ + public Integer getIsDelete() { + return isDelete; + } + /** + * + * @param isDelete + */ + public void setIsDelete(Integer isDelete) { + this.isDelete = isDelete; + } + + /** + * + * @return + */ + public Date getGmtCreate() { + return gmtCreate; + } + /** + * + * @param gmtCreate + */ + public void setGmtCreate(Date gmtCreate) { + this.gmtCreate = gmtCreate; + } + + /** + * + * @return + */ + public Date getGmtModified() { + return gmtModified; + } + /** + * + * @param gmtModified + */ + public void setGmtModified(Date gmtModified) { + this.gmtModified = gmtModified; + } + + /** + * 活动ID + * @return + */ + public Long getLuckId() { + return luckId; + } + /** + * 活动ID + * @param luckId + */ + public void setLuckId(Long luckId) { + this.luckId = luckId; + } + + /** + * 奖品名称 + * @return + */ + public String getName() { + return name; + } + /** + * 奖品名称 + * @param name + */ + public void setName(String name) { + this.name = name; + } + + /** + * 权重 + * @return + */ + public Integer getWeight() { + return weight; + } + /** + * 权重 + * @param weight + */ + public void setWeight(Integer weight) { + this.weight = weight; + } + + /** + * 备注 + * @return + */ + public String getRemark() { + return remark; + } + /** + * 备注 + * @param remark + */ + public void setRemark(String remark) { + this.remark = remark; + } + + /** + * 数量 + * @return + */ + public Integer getCounts() { + return counts; + } + /** + * 数量 + * @param counts + */ + public void setCounts(Integer counts) { + this.counts = counts; + } + + @Override + public String toString() { + return "LuckGoods{" + + ",id=" + id + + ",isDelete=" + isDelete + + ",gmtCreate=" + gmtCreate + + ",gmtModified=" + gmtModified + + ",luckId=" + luckId + + ",name=" + name + + ",weight=" + weight + + ",remark=" + remark + + ",counts=" + counts + + "}"; + } +} \ No newline at end of file diff --git a/src/main/java/com/lz/modules/luck/entity/LuckGoodsReq.java b/src/main/java/com/lz/modules/luck/entity/LuckGoodsReq.java new file mode 100644 index 00000000..108e95bd --- /dev/null +++ b/src/main/java/com/lz/modules/luck/entity/LuckGoodsReq.java @@ -0,0 +1,187 @@ +package com.lz.modules.luck.entity; +import lombok.Data; +import java.util.Date; +/** +*+* 菜单权限表 +*
*奖品表 +* @author quyixiao +* @since 2020-08-21 +*/ + + +@Data +public class LuckGoodsReq implements java.io.Serializable { + + private int page = 1; + private int rows = 10; + private String sort; + private String order; + // + private Long id; + // + private Integer isDelete; + // + private Date gmtCreate; + // + private Date gmtModified; + //活动ID + private Long luckId; + //奖品名称 + private String name; + //权重 + private Integer weight; + //备注 + private String remark; + //数量 + private Integer counts; + /** + * + * @return + */ + public Long getId() { + return id; + } + /** + * + * @param id + */ + public void setId(Long id) { + this.id = id; + } + + /** + * + * @return + */ + public Integer getIsDelete() { + return isDelete; + } + /** + * + * @param isDelete + */ + public void setIsDelete(Integer isDelete) { + this.isDelete = isDelete; + } + + /** + * + * @return + */ + public Date getGmtCreate() { + return gmtCreate; + } + /** + * + * @param gmtCreate + */ + public void setGmtCreate(Date gmtCreate) { + this.gmtCreate = gmtCreate; + } + + /** + * + * @return + */ + public Date getGmtModified() { + return gmtModified; + } + /** + * + * @param gmtModified + */ + public void setGmtModified(Date gmtModified) { + this.gmtModified = gmtModified; + } + + /** + * 活动ID + * @return + */ + public Long getLuckId() { + return luckId; + } + /** + * 活动ID + * @param luckId + */ + public void setLuckId(Long luckId) { + this.luckId = luckId; + } + + /** + * 奖品名称 + * @return + */ + public String getName() { + return name; + } + /** + * 奖品名称 + * @param name + */ + public void setName(String name) { + this.name = name; + } + + /** + * 权重 + * @return + */ + public Integer getWeight() { + return weight; + } + /** + * 权重 + * @param weight + */ + public void setWeight(Integer weight) { + this.weight = weight; + } + + /** + * 备注 + * @return + */ + public String getRemark() { + return remark; + } + /** + * 备注 + * @param remark + */ + public void setRemark(String remark) { + this.remark = remark; + } + + /** + * 数量 + * @return + */ + public Integer getCounts() { + return counts; + } + /** + * 数量 + * @param counts + */ + public void setCounts(Integer counts) { + this.counts = counts; + } + + @Override + public String toString() { + return "LuckGoods{" + + ",id=" + id + + ",isDelete=" + isDelete + + ",gmtCreate=" + gmtCreate + + ",gmtModified=" + gmtModified + + ",luckId=" + luckId + + ",name=" + name + + ",weight=" + weight + + ",remark=" + remark + + ",counts=" + counts + + "}"; + } +} \ No newline at end of file diff --git a/src/main/java/com/lz/modules/luck/entity/LuckRecord.java b/src/main/java/com/lz/modules/luck/entity/LuckRecord.java new file mode 100644 index 00000000..040451bb --- /dev/null +++ b/src/main/java/com/lz/modules/luck/entity/LuckRecord.java @@ -0,0 +1,240 @@ +package com.lz.modules.luck.entity; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import java.util.Date; +/** +*+* 菜单权限表 +*
*中奖记录 +* @author quyixiao +* @since 2020-08-21 +*/ + +@Data +@TableName("luck_record") +public class LuckRecord implements java.io.Serializable { + // + @TableId(value = "id", type = IdType.AUTO) + private Long id; + //是否删除 0未删除 1删除 + private Integer isDelete; + // + private Date gmtCreate; + // + private Date gmtModified; + //员工staff_id + private Long staffId; + //姓名 + private String name; + //是否中将 0为中将 1中将 + private Integer isLuck; + //权重,或者排序 + private Integer weight; + //活动类型 + private Long luckId; + //奖品名称 + private String goodsName; + //奖品ID,目前不设置ID了 + private Long goodsId; + //备注 + private String remark; + /** + * + * @return + */ + public Long getId() { + return id; + } + /** + * + * @param id + */ + public void setId(Long id) { + this.id = id; + } + + /** + * 是否删除 0未删除 1删除 + * @return + */ + public Integer getIsDelete() { + return isDelete; + } + /** + * 是否删除 0未删除 1删除 + * @param isDelete + */ + public void setIsDelete(Integer isDelete) { + this.isDelete = isDelete; + } + + /** + * + * @return + */ + public Date getGmtCreate() { + return gmtCreate; + } + /** + * + * @param gmtCreate + */ + public void setGmtCreate(Date gmtCreate) { + this.gmtCreate = gmtCreate; + } + + /** + * + * @return + */ + public Date getGmtModified() { + return gmtModified; + } + /** + * + * @param gmtModified + */ + public void setGmtModified(Date gmtModified) { + this.gmtModified = gmtModified; + } + + /** + * 员工staff_id + * @return + */ + public Long getStaffId() { + return staffId; + } + /** + * 员工staff_id + * @param staffId + */ + public void setStaffId(Long staffId) { + this.staffId = staffId; + } + + /** + * 姓名 + * @return + */ + public String getName() { + return name; + } + /** + * 姓名 + * @param name + */ + public void setName(String name) { + this.name = name; + } + + /** + * 是否中将 0为中将 1中将 + * @return + */ + public Integer getIsLuck() { + return isLuck; + } + /** + * 是否中将 0为中将 1中将 + * @param isLuck + */ + public void setIsLuck(Integer isLuck) { + this.isLuck = isLuck; + } + + /** + * 权重,或者排序 + * @return + */ + public Integer getWeight() { + return weight; + } + /** + * 权重,或者排序 + * @param weight + */ + public void setWeight(Integer weight) { + this.weight = weight; + } + + /** + * 活动类型 + * @return + */ + public Long getLuckId() { + return luckId; + } + /** + * 活动类型 + * @param luckId + */ + public void setLuckId(Long luckId) { + this.luckId = luckId; + } + + /** + * 奖品名称 + * @return + */ + public String getGoodsName() { + return goodsName; + } + /** + * 奖品名称 + * @param goodsName + */ + public void setGoodsName(String goodsName) { + this.goodsName = goodsName; + } + + /** + * 奖品ID,目前不设置ID了 + * @return + */ + public Long getGoodsId() { + return goodsId; + } + /** + * 奖品ID,目前不设置ID了 + * @param goodsId + */ + public void setGoodsId(Long goodsId) { + this.goodsId = goodsId; + } + + /** + * 备注 + * @return + */ + public String getRemark() { + return remark; + } + /** + * 备注 + * @param remark + */ + public void setRemark(String remark) { + this.remark = remark; + } + + @Override + public String toString() { + return "LuckRecord{" + + ",id=" + id + + ",isDelete=" + isDelete + + ",gmtCreate=" + gmtCreate + + ",gmtModified=" + gmtModified + + ",staffId=" + staffId + + ",name=" + name + + ",isLuck=" + isLuck + + ",weight=" + weight + + ",luckId=" + luckId + + ",goodsName=" + goodsName + + ",goodsId=" + goodsId + + ",remark=" + remark + + "}"; + } +} \ No newline at end of file diff --git a/src/main/java/com/lz/modules/luck/entity/LuckRecordReq.java b/src/main/java/com/lz/modules/luck/entity/LuckRecordReq.java new file mode 100644 index 00000000..28c26bf0 --- /dev/null +++ b/src/main/java/com/lz/modules/luck/entity/LuckRecordReq.java @@ -0,0 +1,241 @@ +package com.lz.modules.luck.entity; +import lombok.Data; +import java.util.Date; +/** +*+* 菜单权限表 +*
*中奖记录 +* @author quyixiao +* @since 2020-08-21 +*/ + + +@Data +public class LuckRecordReq implements java.io.Serializable { + + private int page = 1; + private int rows = 10; + private String sort; + private String order; + // + private Long id; + //是否删除 0未删除 1删除 + private Integer isDelete; + // + private Date gmtCreate; + // + private Date gmtModified; + //员工staff_id + private Long staffId; + //姓名 + private String name; + //是否中将 0为中将 1中将 + private Integer isLuck; + //权重,或者排序 + private Integer weight; + //活动类型 + private Long luckId; + //奖品名称 + private String goodsName; + //奖品ID,目前不设置ID了 + private Long goodsId; + //备注 + private String remark; + /** + * + * @return + */ + public Long getId() { + return id; + } + /** + * + * @param id + */ + public void setId(Long id) { + this.id = id; + } + + /** + * 是否删除 0未删除 1删除 + * @return + */ + public Integer getIsDelete() { + return isDelete; + } + /** + * 是否删除 0未删除 1删除 + * @param isDelete + */ + public void setIsDelete(Integer isDelete) { + this.isDelete = isDelete; + } + + /** + * + * @return + */ + public Date getGmtCreate() { + return gmtCreate; + } + /** + * + * @param gmtCreate + */ + public void setGmtCreate(Date gmtCreate) { + this.gmtCreate = gmtCreate; + } + + /** + * + * @return + */ + public Date getGmtModified() { + return gmtModified; + } + /** + * + * @param gmtModified + */ + public void setGmtModified(Date gmtModified) { + this.gmtModified = gmtModified; + } + + /** + * 员工staff_id + * @return + */ + public Long getStaffId() { + return staffId; + } + /** + * 员工staff_id + * @param staffId + */ + public void setStaffId(Long staffId) { + this.staffId = staffId; + } + + /** + * 姓名 + * @return + */ + public String getName() { + return name; + } + /** + * 姓名 + * @param name + */ + public void setName(String name) { + this.name = name; + } + + /** + * 是否中将 0为中将 1中将 + * @return + */ + public Integer getIsLuck() { + return isLuck; + } + /** + * 是否中将 0为中将 1中将 + * @param isLuck + */ + public void setIsLuck(Integer isLuck) { + this.isLuck = isLuck; + } + + /** + * 权重,或者排序 + * @return + */ + public Integer getWeight() { + return weight; + } + /** + * 权重,或者排序 + * @param weight + */ + public void setWeight(Integer weight) { + this.weight = weight; + } + + /** + * 活动类型 + * @return + */ + public Long getLuckId() { + return luckId; + } + /** + * 活动类型 + * @param luckId + */ + public void setLuckId(Long luckId) { + this.luckId = luckId; + } + + /** + * 奖品名称 + * @return + */ + public String getGoodsName() { + return goodsName; + } + /** + * 奖品名称 + * @param goodsName + */ + public void setGoodsName(String goodsName) { + this.goodsName = goodsName; + } + + /** + * 奖品ID,目前不设置ID了 + * @return + */ + public Long getGoodsId() { + return goodsId; + } + /** + * 奖品ID,目前不设置ID了 + * @param goodsId + */ + public void setGoodsId(Long goodsId) { + this.goodsId = goodsId; + } + + /** + * 备注 + * @return + */ + public String getRemark() { + return remark; + } + /** + * 备注 + * @param remark + */ + public void setRemark(String remark) { + this.remark = remark; + } + + @Override + public String toString() { + return "LuckRecord{" + + ",id=" + id + + ",isDelete=" + isDelete + + ",gmtCreate=" + gmtCreate + + ",gmtModified=" + gmtModified + + ",staffId=" + staffId + + ",name=" + name + + ",isLuck=" + isLuck + + ",weight=" + weight + + ",luckId=" + luckId + + ",goodsName=" + goodsName + + ",goodsId=" + goodsId + + ",remark=" + remark + + "}"; + } +} \ No newline at end of file diff --git a/src/main/java/com/lz/modules/luck/entity/LuckReq.java b/src/main/java/com/lz/modules/luck/entity/LuckReq.java new file mode 100644 index 00000000..7f5f4392 --- /dev/null +++ b/src/main/java/com/lz/modules/luck/entity/LuckReq.java @@ -0,0 +1,169 @@ +package com.lz.modules.luck.entity; +import lombok.Data; +import java.util.Date; +/** +*+* 菜单权限表 +*
*活动名称表 +* @author quyixiao +* @since 2020-08-21 +*/ + + +@Data +public class LuckReq implements java.io.Serializable { + + private int page = 1; + private int rows = 10; + private String sort; + private String order; + //活动ID + private Long id; + //是否删除 + private Integer isDelete; + // + private Date gmtCreate; + // + private Date gmtModified; + //活动名称 + private String name; + //奖品数量 + private Integer goodsCount; + //备注 + private String remark; + //是否结束0为结束 1结束(抽完奖设置为结束) + private Integer finish; + /** + * 活动ID + * @return + */ + public Long getId() { + return id; + } + /** + * 活动ID + * @param id + */ + public void setId(Long id) { + this.id = id; + } + + /** + * 是否删除 + * @return + */ + public Integer getIsDelete() { + return isDelete; + } + /** + * 是否删除 + * @param isDelete + */ + public void setIsDelete(Integer isDelete) { + this.isDelete = isDelete; + } + + /** + * + * @return + */ + public Date getGmtCreate() { + return gmtCreate; + } + /** + * + * @param gmtCreate + */ + public void setGmtCreate(Date gmtCreate) { + this.gmtCreate = gmtCreate; + } + + /** + * + * @return + */ + public Date getGmtModified() { + return gmtModified; + } + /** + * + * @param gmtModified + */ + public void setGmtModified(Date gmtModified) { + this.gmtModified = gmtModified; + } + + /** + * 活动名称 + * @return + */ + public String getName() { + return name; + } + /** + * 活动名称 + * @param name + */ + public void setName(String name) { + this.name = name; + } + + /** + * 奖品数量 + * @return + */ + public Integer getGoodsCount() { + return goodsCount; + } + /** + * 奖品数量 + * @param goodsCount + */ + public void setGoodsCount(Integer goodsCount) { + this.goodsCount = goodsCount; + } + + /** + * 备注 + * @return + */ + public String getRemark() { + return remark; + } + /** + * 备注 + * @param remark + */ + public void setRemark(String remark) { + this.remark = remark; + } + + /** + * 是否结束0为结束 1结束(抽完奖设置为结束) + * @return + */ + public Integer getFinish() { + return finish; + } + /** + * 是否结束0为结束 1结束(抽完奖设置为结束) + * @param finish + */ + public void setFinish(Integer finish) { + this.finish = finish; + } + + @Override + public String toString() { + return "Luck{" + + ",id=" + id + + ",isDelete=" + isDelete + + ",gmtCreate=" + gmtCreate + + ",gmtModified=" + gmtModified + + ",name=" + name + + ",goodsCount=" + goodsCount + + ",remark=" + remark + + ",finish=" + finish + + "}"; + } +} \ No newline at end of file diff --git a/src/main/java/com/lz/modules/luck/service/LuckGoodsService.java b/src/main/java/com/lz/modules/luck/service/LuckGoodsService.java new file mode 100644 index 00000000..ecf0a83b --- /dev/null +++ b/src/main/java/com/lz/modules/luck/service/LuckGoodsService.java @@ -0,0 +1,33 @@ +package com.lz.modules.luck.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.lz.modules.luck.entity.LuckGoods; + +/** +*+* 奖品表 服务类 +*
+* +* @author quyixiao +* @since 2020-08-21 +*/ +public interface LuckGoodsService extends IService+* 中奖记录 服务类 +*
+* +* @author quyixiao +* @since 2020-08-21 +*/ +public interface LuckRecordService extends IService+* 活动名称表 服务类 +*
+* +* @author quyixiao +* @since 2020-08-21 +*/ +public interface LuckService extends IService+* 奖品表 服务类 +*
+* +* @author quyixiao +* @since 2020-08-21 +*/ + +@Service +public class LuckGoodsServiceImpl extends ServiceImpl+* 中奖记录 服务类 +*
+* +* @author quyixiao +* @since 2020-08-21 +*/ + +@Service +public class LuckRecordServiceImpl extends ServiceImpl+* 活动名称表 服务类 +*
+* +* @author quyixiao +* @since 2020-08-21 +*/ + +@Service +public class LuckServiceImpl extends ServiceImpl+ 姓名:吴林 是否中将:中将 +
*/ + value = ""; + for (int i = 0; i < luckRecords.size(); i++){ + LuckRecord luckRecord = luckRecords.get(i); + value += "" + (i + 1) + ":姓名:" + luckRecord.getName() + + " 是否中将:未中将" : "\"color:#E53333;\">中将") + + "
"; + } + } + return value; + + } } diff --git a/src/main/resources/mapper/luck/LuckGoodsMapper.xml b/src/main/resources/mapper/luck/LuckGoodsMapper.xml new file mode 100644 index 00000000..30bb1ed1 --- /dev/null +++ b/src/main/resources/mapper/luck/LuckGoodsMapper.xml @@ -0,0 +1,93 @@ + + +