增加钉钉免登,抽奖相关
This commit is contained in:
parent
685e21b4bb
commit
d0876216cc
@ -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());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -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);
|
||||
|
||||
|
||||
@ -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("授权失败,未授权");
|
||||
}
|
||||
}
|
||||
|
||||
@ -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();
|
||||
}
|
||||
}
|
||||
@ -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();
|
||||
}
|
||||
}
|
||||
@ -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();
|
||||
}
|
||||
}
|
||||
33
src/main/java/com/lz/modules/luck/dao/LuckGoodsMapper.java
Normal file
33
src/main/java/com/lz/modules/luck/dao/LuckGoodsMapper.java
Normal file
@ -0,0 +1,33 @@
|
||||
package com.lz.modules.luck.dao;
|
||||
/**
|
||||
* <p>
|
||||
* 奖品表 服务类
|
||||
* </p>
|
||||
*
|
||||
* @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<LuckGoods> {
|
||||
|
||||
|
||||
LuckGoods selectLuckGoodsById(@Param("id")Long id);
|
||||
|
||||
|
||||
Long insertLuckGoods(LuckGoods luckGoods);
|
||||
|
||||
|
||||
int updateLuckGoodsById(LuckGoods luckGoods);
|
||||
|
||||
|
||||
int updateCoverLuckGoodsById(LuckGoods luckGoods);
|
||||
|
||||
|
||||
int deleteLuckGoodsById(@Param("id")Long id);
|
||||
|
||||
|
||||
}
|
||||
33
src/main/java/com/lz/modules/luck/dao/LuckMapper.java
Normal file
33
src/main/java/com/lz/modules/luck/dao/LuckMapper.java
Normal file
@ -0,0 +1,33 @@
|
||||
package com.lz.modules.luck.dao;
|
||||
/**
|
||||
* <p>
|
||||
* 活动名称表 服务类
|
||||
* </p>
|
||||
*
|
||||
* @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<Luck> {
|
||||
|
||||
|
||||
Luck selectLuckById(@Param("id")Long id);
|
||||
|
||||
|
||||
Long insertLuck(Luck luck);
|
||||
|
||||
|
||||
int updateLuckById(Luck luck);
|
||||
|
||||
|
||||
int updateCoverLuckById(Luck luck);
|
||||
|
||||
|
||||
int deleteLuckById(@Param("id")Long id);
|
||||
|
||||
|
||||
}
|
||||
39
src/main/java/com/lz/modules/luck/dao/LuckRecordMapper.java
Normal file
39
src/main/java/com/lz/modules/luck/dao/LuckRecordMapper.java
Normal file
@ -0,0 +1,39 @@
|
||||
package com.lz.modules.luck.dao;
|
||||
/**
|
||||
* <p>
|
||||
* 中奖记录 服务类
|
||||
* </p>
|
||||
*
|
||||
* @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<LuckRecord> {
|
||||
|
||||
|
||||
LuckRecord selectLuckRecordById(@Param("id")Long id);
|
||||
|
||||
|
||||
Long insertLuckRecord(LuckRecord luckRecord);
|
||||
|
||||
|
||||
int updateLuckRecordById(LuckRecord luckRecord);
|
||||
|
||||
|
||||
int updateCoverLuckRecordById(LuckRecord luckRecord);
|
||||
|
||||
|
||||
int deleteLuckRecordById(@Param("id")Long id);
|
||||
|
||||
|
||||
LuckRecord selectLuckRecordByLuckIdAndStaffId(@Param("luckId") Long luckId, @Param("id") Long id);
|
||||
|
||||
List<LuckRecord> selectLuckRecordByLuckId(@Param("luckId") String luckId);
|
||||
}
|
||||
204
src/main/java/com/lz/modules/luck/entity/Luck.java
Normal file
204
src/main/java/com/lz/modules/luck/entity/Luck.java
Normal file
@ -0,0 +1,204 @@
|
||||
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;
|
||||
/**
|
||||
* <p>
|
||||
* 菜单权限表
|
||||
* </p>*活动名称表
|
||||
* @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 +
|
||||
"}";
|
||||
}
|
||||
}
|
||||
186
src/main/java/com/lz/modules/luck/entity/LuckGoods.java
Normal file
186
src/main/java/com/lz/modules/luck/entity/LuckGoods.java
Normal file
@ -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;
|
||||
/**
|
||||
* <p>
|
||||
* 菜单权限表
|
||||
* </p>*奖品表
|
||||
* @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 +
|
||||
"}";
|
||||
}
|
||||
}
|
||||
187
src/main/java/com/lz/modules/luck/entity/LuckGoodsReq.java
Normal file
187
src/main/java/com/lz/modules/luck/entity/LuckGoodsReq.java
Normal file
@ -0,0 +1,187 @@
|
||||
package com.lz.modules.luck.entity;
|
||||
import lombok.Data;
|
||||
import java.util.Date;
|
||||
/**
|
||||
* <p>
|
||||
* 菜单权限表
|
||||
* </p>*奖品表
|
||||
* @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 +
|
||||
"}";
|
||||
}
|
||||
}
|
||||
240
src/main/java/com/lz/modules/luck/entity/LuckRecord.java
Normal file
240
src/main/java/com/lz/modules/luck/entity/LuckRecord.java
Normal file
@ -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;
|
||||
/**
|
||||
* <p>
|
||||
* 菜单权限表
|
||||
* </p>*中奖记录
|
||||
* @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 +
|
||||
"}";
|
||||
}
|
||||
}
|
||||
241
src/main/java/com/lz/modules/luck/entity/LuckRecordReq.java
Normal file
241
src/main/java/com/lz/modules/luck/entity/LuckRecordReq.java
Normal file
@ -0,0 +1,241 @@
|
||||
package com.lz.modules.luck.entity;
|
||||
import lombok.Data;
|
||||
import java.util.Date;
|
||||
/**
|
||||
* <p>
|
||||
* 菜单权限表
|
||||
* </p>*中奖记录
|
||||
* @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 +
|
||||
"}";
|
||||
}
|
||||
}
|
||||
169
src/main/java/com/lz/modules/luck/entity/LuckReq.java
Normal file
169
src/main/java/com/lz/modules/luck/entity/LuckReq.java
Normal file
@ -0,0 +1,169 @@
|
||||
package com.lz.modules.luck.entity;
|
||||
import lombok.Data;
|
||||
import java.util.Date;
|
||||
/**
|
||||
* <p>
|
||||
* 菜单权限表
|
||||
* </p>*活动名称表
|
||||
* @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 +
|
||||
"}";
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,33 @@
|
||||
package com.lz.modules.luck.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.lz.modules.luck.entity.LuckGoods;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 奖品表 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author quyixiao
|
||||
* @since 2020-08-21
|
||||
*/
|
||||
public interface LuckGoodsService extends IService<LuckGoods> {
|
||||
|
||||
|
||||
|
||||
LuckGoods selectLuckGoodsById(Long id);
|
||||
|
||||
|
||||
Long insertLuckGoods(LuckGoods luckGoods);
|
||||
|
||||
|
||||
int updateLuckGoodsById(LuckGoods luckGoods);
|
||||
|
||||
|
||||
int updateCoverLuckGoodsById(LuckGoods luckGoods);
|
||||
|
||||
|
||||
int deleteLuckGoodsById(Long id);
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,38 @@
|
||||
package com.lz.modules.luck.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.lz.modules.luck.entity.LuckRecord;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 中奖记录 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author quyixiao
|
||||
* @since 2020-08-21
|
||||
*/
|
||||
public interface LuckRecordService extends IService<LuckRecord> {
|
||||
|
||||
|
||||
|
||||
LuckRecord selectLuckRecordById(Long id);
|
||||
|
||||
|
||||
Long insertLuckRecord(LuckRecord luckRecord);
|
||||
|
||||
|
||||
int updateLuckRecordById(LuckRecord luckRecord);
|
||||
|
||||
|
||||
int updateCoverLuckRecordById(LuckRecord luckRecord);
|
||||
|
||||
|
||||
int deleteLuckRecordById(Long id);
|
||||
|
||||
|
||||
LuckRecord selectLuckRecordByLuckIdAndStaffId(Long luckId, Long id);
|
||||
|
||||
List<LuckRecord> selectLuckRecordByLuckId(String luckId);
|
||||
}
|
||||
33
src/main/java/com/lz/modules/luck/service/LuckService.java
Normal file
33
src/main/java/com/lz/modules/luck/service/LuckService.java
Normal file
@ -0,0 +1,33 @@
|
||||
package com.lz.modules.luck.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.lz.modules.luck.entity.Luck;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 活动名称表 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author quyixiao
|
||||
* @since 2020-08-21
|
||||
*/
|
||||
public interface LuckService extends IService<Luck> {
|
||||
|
||||
|
||||
|
||||
Luck selectLuckById(Long id);
|
||||
|
||||
|
||||
Long insertLuck(Luck luck);
|
||||
|
||||
|
||||
int updateLuckById(Luck luck);
|
||||
|
||||
|
||||
int updateCoverLuckById(Luck luck);
|
||||
|
||||
|
||||
int deleteLuckById(Long id);
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,63 @@
|
||||
package com.lz.modules.luck.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.lz.modules.luck.dao.LuckGoodsMapper;
|
||||
import com.lz.modules.luck.entity.LuckGoods;
|
||||
import com.lz.modules.luck.service.LuckGoodsService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 奖品表 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author quyixiao
|
||||
* @since 2020-08-21
|
||||
*/
|
||||
|
||||
@Service
|
||||
public class LuckGoodsServiceImpl extends ServiceImpl<LuckGoodsMapper, LuckGoods> implements LuckGoodsService {
|
||||
|
||||
|
||||
@Autowired
|
||||
private LuckGoodsMapper luckGoodsMapper;
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public LuckGoods selectLuckGoodsById(Long id){
|
||||
return luckGoodsMapper.selectLuckGoodsById(id);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public Long insertLuckGoods(LuckGoods luckGoods){
|
||||
return luckGoodsMapper.insertLuckGoods(luckGoods);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public int updateLuckGoodsById(LuckGoods luckGoods){
|
||||
return luckGoodsMapper.updateLuckGoodsById(luckGoods);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public int updateCoverLuckGoodsById(LuckGoods luckGoods){
|
||||
return luckGoodsMapper.updateCoverLuckGoodsById(luckGoods);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public int deleteLuckGoodsById(Long id){
|
||||
return luckGoodsMapper.deleteLuckGoodsById(id);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,73 @@
|
||||
package com.lz.modules.luck.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.lz.modules.luck.dao.LuckRecordMapper;
|
||||
import com.lz.modules.luck.entity.LuckRecord;
|
||||
import com.lz.modules.luck.service.LuckRecordService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 中奖记录 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author quyixiao
|
||||
* @since 2020-08-21
|
||||
*/
|
||||
|
||||
@Service
|
||||
public class LuckRecordServiceImpl extends ServiceImpl<LuckRecordMapper, LuckRecord> implements LuckRecordService {
|
||||
|
||||
|
||||
@Autowired
|
||||
private LuckRecordMapper luckRecordMapper;
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public LuckRecord selectLuckRecordById(Long id){
|
||||
return luckRecordMapper.selectLuckRecordById(id);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public Long insertLuckRecord(LuckRecord luckRecord){
|
||||
return luckRecordMapper.insertLuckRecord(luckRecord);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public int updateLuckRecordById(LuckRecord luckRecord){
|
||||
return luckRecordMapper.updateLuckRecordById(luckRecord);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public int updateCoverLuckRecordById(LuckRecord luckRecord){
|
||||
return luckRecordMapper.updateCoverLuckRecordById(luckRecord);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public int deleteLuckRecordById(Long id){
|
||||
return luckRecordMapper.deleteLuckRecordById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public LuckRecord selectLuckRecordByLuckIdAndStaffId(Long luckId, Long id){
|
||||
return luckRecordMapper.selectLuckRecordByLuckIdAndStaffId(luckId, id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<LuckRecord> selectLuckRecordByLuckId(String luckId){
|
||||
return luckRecordMapper.selectLuckRecordByLuckId(luckId);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,63 @@
|
||||
package com.lz.modules.luck.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.lz.modules.luck.dao.LuckMapper;
|
||||
import com.lz.modules.luck.entity.Luck;
|
||||
import com.lz.modules.luck.service.LuckService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 活动名称表 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author quyixiao
|
||||
* @since 2020-08-21
|
||||
*/
|
||||
|
||||
@Service
|
||||
public class LuckServiceImpl extends ServiceImpl<LuckMapper, Luck> implements LuckService {
|
||||
|
||||
|
||||
@Autowired
|
||||
private LuckMapper luckMapper;
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public Luck selectLuckById(Long id){
|
||||
return luckMapper.selectLuckById(id);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public Long insertLuck(Luck luck){
|
||||
return luckMapper.insertLuck(luck);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public int updateLuckById(Luck luck){
|
||||
return luckMapper.updateLuckById(luck);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public int updateCoverLuckById(Luck luck){
|
||||
return luckMapper.updateCoverLuckById(luck);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public int deleteLuckById(Long id){
|
||||
return luckMapper.deleteLuckById(id);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -4,18 +4,26 @@ import com.alibaba.fastjson.JSONObject;
|
||||
import com.lz.common.utils.DingTalkUtil;
|
||||
import com.lz.common.utils.R;
|
||||
import com.lz.modules.job.business.DingtalkBusiness;
|
||||
import com.lz.modules.luck.entity.Luck;
|
||||
import com.lz.modules.luck.entity.LuckRecord;
|
||||
import com.lz.modules.luck.service.LuckRecordService;
|
||||
import com.lz.modules.luck.service.LuckService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/dtlg")
|
||||
public class DingTalkLoginController {
|
||||
@Autowired
|
||||
DingtalkBusiness dingtalkBusiness;
|
||||
@Autowired
|
||||
LuckService luckService;
|
||||
@Autowired
|
||||
LuckRecordService luckRecordService;
|
||||
static String appid = "855818566";
|
||||
@PostMapping("/login")
|
||||
public R login(@RequestBody String body){
|
||||
@ -23,4 +31,37 @@ public class DingTalkLoginController {
|
||||
return dingtalkBusiness.login(json.getString("code"), appid);
|
||||
|
||||
}
|
||||
|
||||
@PostMapping("/luck")
|
||||
public R luck(@RequestBody String body){
|
||||
JSONObject json = JSONObject.parseObject(body);
|
||||
Luck luck = luckService.selectLuckById(1L);//默认第一个活动
|
||||
if(luck.getStopTime().getTime() > System.currentTimeMillis()){
|
||||
return dingtalkBusiness.luck(json.getString("code"), appid, luck.getId());
|
||||
}
|
||||
return R.error("活动已经停止");
|
||||
|
||||
}
|
||||
|
||||
@GetMapping("/look")
|
||||
public String look(@RequestParam String luckId){
|
||||
List<LuckRecord> luckRecords = luckRecordService.selectLuckRecordByLuckId(luckId);
|
||||
String value = "暂无人员报名";
|
||||
if(luckRecords.size() > 0){
|
||||
/*
|
||||
<p>
|
||||
姓名:<span style="color:#E53333;">吴林</span> 是否中将:<span style="color:#009900;">中将</span>
|
||||
</p>*/
|
||||
value = "";
|
||||
for (int i = 0; i < luckRecords.size(); i++){
|
||||
LuckRecord luckRecord = luckRecords.get(i);
|
||||
value += "<p>" + (i + 1) + ":姓名:<span style=\"color:#000000;\"><strong>" + luckRecord.getName()
|
||||
+ "</strong></span> 是否中将:<span style=" +
|
||||
(luckRecord.getIsLuck() == 0 ? "\"color:#000000;\">未中将" : "\"color:#E53333;\">中将") +
|
||||
"</span></p>";
|
||||
}
|
||||
}
|
||||
return value;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
93
src/main/resources/mapper/luck/LuckGoodsMapper.xml
Normal file
93
src/main/resources/mapper/luck/LuckGoodsMapper.xml
Normal file
@ -0,0 +1,93 @@
|
||||
<?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="com.lz.modules.luck.dao.LuckGoodsMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="com.lz.modules.luck.entity.LuckGoods">
|
||||
<id column="id" property="id"/>
|
||||
<result column="is_delete" property="isDelete"/>
|
||||
<result column="gmt_create" property="gmtCreate"/>
|
||||
<result column="gmt_modified" property="gmtModified"/>
|
||||
<result column="luck_id" property="luckId"/>
|
||||
<result column="name" property="name"/>
|
||||
<result column="weight" property="weight"/>
|
||||
<result column="remark" property="remark"/>
|
||||
<result column="counts" property="counts"/>
|
||||
</resultMap>
|
||||
|
||||
|
||||
<!-- 通用查询结果列 -->
|
||||
<sql id="Base_Column_List">
|
||||
id AS id, is_delete AS isDelete, gmt_create AS gmtCreate, gmt_modified AS gmtModified, luck_id AS luckId, name AS name, weight AS weight, remark AS remark, counts AS counts
|
||||
</sql>
|
||||
|
||||
|
||||
|
||||
|
||||
<select id="selectLuckGoodsById" resultType="LuckGoods" >
|
||||
select * from luck_goods where id=#{id} and is_delete = 0 limit 1
|
||||
</select>
|
||||
|
||||
|
||||
<insert id="insertLuckGoods" parameterType="LuckGoods" useGeneratedKeys="true" keyProperty="id" >
|
||||
insert into luck_goods(
|
||||
<if test="luckId != null">luck_id, </if>
|
||||
<if test="name != null">name, </if>
|
||||
<if test="weight != null">weight, </if>
|
||||
<if test="remark != null">remark, </if>
|
||||
<if test="counts != null">counts, </if>
|
||||
is_delete,
|
||||
gmt_create,
|
||||
gmt_modified
|
||||
)values(
|
||||
<if test="luckId != null">#{ luckId}, </if>
|
||||
<if test="name != null">#{ name}, </if>
|
||||
<if test="weight != null">#{ weight}, </if>
|
||||
<if test="remark != null">#{ remark}, </if>
|
||||
<if test="counts != null">#{ counts}, </if>
|
||||
0,
|
||||
now(),
|
||||
now()
|
||||
)
|
||||
</insert>
|
||||
|
||||
|
||||
<update id="updateLuckGoodsById" parameterType="LuckGoods" >
|
||||
update
|
||||
luck_goods
|
||||
<trim prefix="set" suffixOverrides=",">
|
||||
<if test="isDelete != null">is_delete = #{isDelete},</if>
|
||||
<if test="gmtCreate != null">gmt_create = #{gmtCreate},</if>
|
||||
<if test="luckId != null">luck_id = #{luckId},</if>
|
||||
<if test="name != null">name = #{name},</if>
|
||||
<if test="weight != null">weight = #{weight},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="counts != null">counts = #{counts}</if>
|
||||
</trim>
|
||||
,gmt_modified = now()
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
|
||||
<update id="updateCoverLuckGoodsById" parameterType="LuckGoods" >
|
||||
update
|
||||
luck_goods
|
||||
set
|
||||
is_delete = #{isDelete},
|
||||
gmt_create = #{gmtCreate},
|
||||
luck_id = #{luckId},
|
||||
name = #{name},
|
||||
weight = #{weight},
|
||||
remark = #{remark},
|
||||
counts = #{counts}
|
||||
,gmt_modified = now()
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
|
||||
<update id="deleteLuckGoodsById" parameterType="java.lang.Long">
|
||||
update luck_goods set is_delete = 1 where id=#{id} limit 1
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
|
||||
98
src/main/resources/mapper/luck/LuckMapper.xml
Normal file
98
src/main/resources/mapper/luck/LuckMapper.xml
Normal file
@ -0,0 +1,98 @@
|
||||
<?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="com.lz.modules.luck.dao.LuckMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="com.lz.modules.luck.entity.Luck">
|
||||
<id column="id" property="id"/>
|
||||
<result column="is_delete" property="isDelete"/>
|
||||
<result column="gmt_create" property="gmtCreate"/>
|
||||
<result column="gmt_modified" property="gmtModified"/>
|
||||
<result column="name" property="name"/>
|
||||
<result column="goods_count" property="goodsCount"/>
|
||||
<result column="remark" property="remark"/>
|
||||
<result column="finish" property="finish"/>
|
||||
<result column="stop_time" property="stopTime"/>
|
||||
<result column="start_time" property="startTime"/>
|
||||
</resultMap>
|
||||
|
||||
|
||||
<!-- 通用查询结果列 -->
|
||||
<sql id="Base_Column_List">
|
||||
id AS id, is_delete AS isDelete, gmt_create AS gmtCreate, gmt_modified AS gmtModified, name AS name, goods_count AS goodsCount, remark AS remark, finish AS finish, stop_time AS stopTime, start_time AS startTime
|
||||
</sql>
|
||||
|
||||
|
||||
|
||||
|
||||
<select id="selectLuckById" resultType="Luck" >
|
||||
select * from luck where id=#{id} and is_delete = 0 limit 1
|
||||
</select>
|
||||
|
||||
|
||||
<insert id="insertLuck" parameterType="Luck" useGeneratedKeys="true" keyProperty="id" >
|
||||
insert into luck(
|
||||
<if test="name != null">name, </if>
|
||||
<if test="goodsCount != null">goods_count, </if>
|
||||
<if test="remark != null">remark, </if>
|
||||
<if test="finish != null">finish, </if>
|
||||
<if test="stopTime != null">stop_time, </if>
|
||||
<if test="startTime != null">start_time, </if>
|
||||
is_delete,
|
||||
gmt_create,
|
||||
gmt_modified
|
||||
)values(
|
||||
<if test="name != null">#{ name}, </if>
|
||||
<if test="goodsCount != null">#{ goodsCount}, </if>
|
||||
<if test="remark != null">#{ remark}, </if>
|
||||
<if test="finish != null">#{ finish}, </if>
|
||||
<if test="stopTime != null">#{ stopTime}, </if>
|
||||
<if test="startTime != null">#{ startTime}, </if>
|
||||
0,
|
||||
now(),
|
||||
now()
|
||||
)
|
||||
</insert>
|
||||
|
||||
|
||||
<update id="updateLuckById" parameterType="Luck" >
|
||||
update
|
||||
luck
|
||||
<trim prefix="set" suffixOverrides=",">
|
||||
<if test="isDelete != null">is_delete = #{isDelete},</if>
|
||||
<if test="gmtCreate != null">gmt_create = #{gmtCreate},</if>
|
||||
<if test="name != null">name = #{name},</if>
|
||||
<if test="goodsCount != null">goods_count = #{goodsCount},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="finish != null">finish = #{finish},</if>
|
||||
<if test="stopTime != null">stop_time = #{stopTime},</if>
|
||||
<if test="startTime != null">start_time = #{startTime}</if>
|
||||
</trim>
|
||||
,gmt_modified = now()
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
|
||||
<update id="updateCoverLuckById" parameterType="Luck" >
|
||||
update
|
||||
luck
|
||||
set
|
||||
is_delete = #{isDelete},
|
||||
gmt_create = #{gmtCreate},
|
||||
name = #{name},
|
||||
goods_count = #{goodsCount},
|
||||
remark = #{remark},
|
||||
finish = #{finish},
|
||||
stop_time = #{stopTime},
|
||||
start_time = #{startTime}
|
||||
,gmt_modified = now()
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
|
||||
<update id="deleteLuckById" parameterType="java.lang.Long">
|
||||
update luck set is_delete = 1 where id=#{id} limit 1
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
|
||||
116
src/main/resources/mapper/luck/LuckRecordMapper.xml
Normal file
116
src/main/resources/mapper/luck/LuckRecordMapper.xml
Normal file
@ -0,0 +1,116 @@
|
||||
<?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="com.lz.modules.luck.dao.LuckRecordMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="com.lz.modules.luck.entity.LuckRecord">
|
||||
<id column="id" property="id"/>
|
||||
<result column="is_delete" property="isDelete"/>
|
||||
<result column="gmt_create" property="gmtCreate"/>
|
||||
<result column="gmt_modified" property="gmtModified"/>
|
||||
<result column="staff_id" property="staffId"/>
|
||||
<result column="name" property="name"/>
|
||||
<result column="is_luck" property="isLuck"/>
|
||||
<result column="weight" property="weight"/>
|
||||
<result column="luck_id" property="luckId"/>
|
||||
<result column="goods_name" property="goodsName"/>
|
||||
<result column="goods_id" property="goodsId"/>
|
||||
<result column="remark" property="remark"/>
|
||||
</resultMap>
|
||||
|
||||
|
||||
<!-- 通用查询结果列 -->
|
||||
<sql id="Base_Column_List">
|
||||
id AS id, is_delete AS isDelete, gmt_create AS gmtCreate, gmt_modified AS gmtModified, staff_id AS staffId, name AS name, is_luck AS isLuck, weight AS weight, luck_id AS luckId, goods_name AS goodsName, goods_id AS goodsId, remark AS remark
|
||||
</sql>
|
||||
|
||||
|
||||
|
||||
|
||||
<select id="selectLuckRecordById" resultType="LuckRecord" >
|
||||
select * from luck_record where id=#{id} and is_delete = 0 limit 1
|
||||
</select>
|
||||
|
||||
|
||||
<insert id="insertLuckRecord" parameterType="LuckRecord" useGeneratedKeys="true" keyProperty="id" >
|
||||
insert into luck_record(
|
||||
<if test="staffId != null">staff_id, </if>
|
||||
<if test="name != null">name, </if>
|
||||
<if test="isLuck != null">is_luck, </if>
|
||||
<if test="weight != null">weight, </if>
|
||||
<if test="luckId != null">luck_id, </if>
|
||||
<if test="goodsName != null">goods_name, </if>
|
||||
<if test="goodsId != null">goods_id, </if>
|
||||
<if test="remark != null">remark, </if>
|
||||
is_delete,
|
||||
gmt_create,
|
||||
gmt_modified
|
||||
)values(
|
||||
<if test="staffId != null">#{ staffId}, </if>
|
||||
<if test="name != null">#{ name}, </if>
|
||||
<if test="isLuck != null">#{ isLuck}, </if>
|
||||
<if test="weight != null">#{ weight}, </if>
|
||||
<if test="luckId != null">#{ luckId}, </if>
|
||||
<if test="goodsName != null">#{ goodsName}, </if>
|
||||
<if test="goodsId != null">#{ goodsId}, </if>
|
||||
<if test="remark != null">#{ remark}, </if>
|
||||
0,
|
||||
now(),
|
||||
now()
|
||||
)
|
||||
</insert>
|
||||
|
||||
|
||||
<update id="updateLuckRecordById" parameterType="LuckRecord" >
|
||||
update
|
||||
luck_record
|
||||
<trim prefix="set" suffixOverrides=",">
|
||||
<if test="isDelete != null">is_delete = #{isDelete},</if>
|
||||
<if test="gmtCreate != null">gmt_create = #{gmtCreate},</if>
|
||||
<if test="staffId != null">staff_id = #{staffId},</if>
|
||||
<if test="name != null">name = #{name},</if>
|
||||
<if test="isLuck != null">is_luck = #{isLuck},</if>
|
||||
<if test="weight != null">weight = #{weight},</if>
|
||||
<if test="luckId != null">luck_id = #{luckId},</if>
|
||||
<if test="goodsName != null">goods_name = #{goodsName},</if>
|
||||
<if test="goodsId != null">goods_id = #{goodsId},</if>
|
||||
<if test="remark != null">remark = #{remark}</if>
|
||||
</trim>
|
||||
,gmt_modified = now()
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
|
||||
<update id="updateCoverLuckRecordById" parameterType="LuckRecord" >
|
||||
update
|
||||
luck_record
|
||||
set
|
||||
is_delete = #{isDelete},
|
||||
gmt_create = #{gmtCreate},
|
||||
staff_id = #{staffId},
|
||||
name = #{name},
|
||||
is_luck = #{isLuck},
|
||||
weight = #{weight},
|
||||
luck_id = #{luckId},
|
||||
goods_name = #{goodsName},
|
||||
goods_id = #{goodsId},
|
||||
remark = #{remark}
|
||||
,gmt_modified = now()
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
|
||||
<update id="deleteLuckRecordById" parameterType="java.lang.Long">
|
||||
update luck_record set is_delete = 1 where id=#{id} limit 1
|
||||
</update>
|
||||
|
||||
<select id="selectLuckRecordByLuckIdAndStaffId" resultType="LuckRecord" >
|
||||
select * from luck_record where luck_id=#{luckId} and staff_id=#{id} and is_delete = 0 limit 1
|
||||
</select>
|
||||
|
||||
<select id="selectLuckRecordByLuckId" resultType="LuckRecord" >
|
||||
select * from luck_record where luck_id=#{luckId}and is_delete = 0
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
@ -62,7 +62,7 @@ public class MysqlMain {
|
||||
List<TablesBean> list = new ArrayList<TablesBean>();
|
||||
|
||||
|
||||
list.add(new TablesBean("lz_flow_record"));
|
||||
list.add(new TablesBean("luck"));
|
||||
|
||||
|
||||
List<TablesBean> list2 = new ArrayList<TablesBean>();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user