记得上下班打卡 | git大法好,push需谨慎

Commit 33038355 authored by 高虎's avatar 高虎 Committed by GaoHu

exit

parent e5076ffe
...@@ -41,25 +41,25 @@ public class GoblinGoodsAnticipateController { ...@@ -41,25 +41,25 @@ public class GoblinGoodsAnticipateController {
@ApiOperation("创建预约信息") @ApiOperation("创建预约信息")
@PostMapping("/add") @PostMapping("/add")
public ResponseDto<Object> add(@RequestBody GoblinGoodsAnticipateAddParam goodsAnticipateAddParam){ public ResponseDto<Object> add(@RequestBody GoblinGoodsAnticipateAddParam goodsAnticipateAddParam) {
return goblinGoodsAnticipateService.add(goodsAnticipateAddParam); return goblinGoodsAnticipateService.add(goodsAnticipateAddParam);
} }
@ApiOperation("修改预约人数") @ApiOperation("修改预约人数")
@PostMapping("/updatePeople") @PostMapping("/updatePeople")
public ResponseDto<Object> updatePeople(@RequestParam(name = "antId", required = true) String antId,@RequestParam(name = "people", required = true) Long people){ public ResponseDto<Object> updatePeople(@RequestParam(name = "antId", required = true) String antId, @RequestParam(name = "people", required = true) Long people) {
return goblinGoodsAnticipateService.updatePeople(antId,people); return goblinGoodsAnticipateService.updatePeople(antId, people);
} }
@ApiOperation("修改预约") @ApiOperation("修改预约")
@PostMapping("/update") @PostMapping("/update")
public ResponseDto<Object> update(GoblinGoodsAnticipateUpdateParam goodsAnticipateUpdateParam){ public ResponseDto<Object> update(GoblinGoodsAnticipateUpdateParam goodsAnticipateUpdateParam) {
return goblinGoodsAnticipateService.update(goodsAnticipateUpdateParam); return goblinGoodsAnticipateService.update(goodsAnticipateUpdateParam);
} }
@ApiOperation("删除预约") @ApiOperation("删除预约")
@DeleteMapping("/delete") @DeleteMapping("/delete")
public ResponseDto<Object> delete(@RequestParam(name = "antId")String antId){ public ResponseDto<Object> delete(@RequestParam(name = "antId") String antId) {
return goblinGoodsAnticipateService.delete(antId); return goblinGoodsAnticipateService.delete(antId);
} }
...@@ -69,13 +69,13 @@ public class GoblinGoodsAnticipateController { ...@@ -69,13 +69,13 @@ public class GoblinGoodsAnticipateController {
@RequestParam(name = "skuId", required = true) String skuId, @RequestParam(name = "skuId", required = true) String skuId,
@RequestParam(name = "uid", required = true) String uid, @RequestParam(name = "uid", required = true) String uid,
@RequestParam(name = "phone", required = true) String phone, @RequestParam(name = "phone", required = true) String phone,
@RequestParam(name = "state",required = true)Integer state){ @RequestParam(name = "state", required = true) Integer state) {
return goblinGoodsAnticipateService.userAbout(antId,skuId,uid,phone,state); return goblinGoodsAnticipateService.userAbout(antId, skuId, uid, phone, state);
} }
@ApiOperation("根据spuid查询出所有的sku") @ApiOperation("根据spuid查询出所有的sku")
@PostMapping("") @PostMapping("")
public ResponseDto<Object> getSkus(@RequestParam(name = "apuId")String SpuId){ public ResponseDto<Object> getSkus(@RequestParam(name = "apuId") String SpuId) {
return goblinGoodsAnticipateService.getSkus(SpuId); return goblinGoodsAnticipateService.getSkus(SpuId);
} }
} }
...@@ -166,14 +166,29 @@ public class GoblinGoodsAnticipateServiceImpl implements IGoblinGoodsAnticipateS ...@@ -166,14 +166,29 @@ public class GoblinGoodsAnticipateServiceImpl implements IGoblinGoodsAnticipateS
public ResponseDto<Object> userAbout(String autId,String skuId, String uid, String phone, Integer state) { public ResponseDto<Object> userAbout(String autId,String skuId, String uid, String phone, Integer state) {
//查询该用户是否预 //查询该用户是否预
GoblinGoodAnticipateUserVo userVo = goblinRedisUtils.getUserAboutAut(skuId,uid); GoblinGoodAnticipateUserVo userVo = goblinRedisUtils.getUserAboutAut(skuId,uid);
LinkedList<Object[]> sqlValue = CollectionUtil.linkedListObjectArr();
if (state.equals(GoblinGoodAnticipateUserVo.STATE_VALID) &&userVo==null) { if (state.equals(GoblinGoodAnticipateUserVo.STATE_VALID) &&userVo==null) {
//用户没有预约过 //用户没有预约过
//发送redis消息修改mysql记录用户预约 //发送redis消息修改mysql记录用户预约
sqlValue.add(new Object[]{
uid,
skuId,
phone,
state
});
sendRedis("goblin_goods_anticipate_user",sqlValue);
GoblinGoodAnticipateUserVo user = new GoblinGoodAnticipateUserVo(uid,skuId,phone,state); GoblinGoodAnticipateUserVo user = new GoblinGoodAnticipateUserVo(uid,skuId,phone,state);
//mongodb记录 //mongodb记录
goblinRedisUtils.setUserAboutSku(user); goblinRedisUtils.setUserAboutSku(user);
//预约人数+1或-1 //预约人数+1或-1
}else { }else {
//mysql删除用户记录
sqlValue.add(new Object[]{
uid,
skuId
});
sendRedis("goblin_goods_anticipate_user_update",sqlValue);
//删除缓存 redis和mongodb
goblinRedisUtils.delUserAboutSku(skuId,uid); goblinRedisUtils.delUserAboutSku(skuId,uid);
} }
goblinRedisUtils.setAutId(autId,state); goblinRedisUtils.setAutId(autId,state);
......
...@@ -136,6 +136,7 @@ goblin_user_digital_artwork.update_for_unboxing=UPDATE goblin_user_digital_artwo ...@@ -136,6 +136,7 @@ goblin_user_digital_artwork.update_for_unboxing=UPDATE goblin_user_digital_artwo
#---- \u9884\u7EA6 #---- \u9884\u7EA6
goblin_goods_anticipate=INSERT INTO goblin_goods_anticipate(ant_id,`name`,`rule`,actual_people,about_start_date,about_end_date,created_date,del_tag) VALUES(?,?,?,0,?,?,NOW(),0) goblin_goods_anticipate=INSERT INTO goblin_goods_anticipate(ant_id,`name`,`rule`,actual_people,about_start_date,about_end_date,created_date,del_tag) VALUES(?,?,?,0,?,?,NOW(),0)
goblin_goods_anticipate_value=INSERT INTO goblin_goods_anticipate_value (ant_id,sku_name,sku_id,spu_id,about_start_date,about_end_date,created_date,del_tag) VALUES(?,?,?,?,?,?,NOW(),0) goblin_goods_anticipate_value=INSERT INTO goblin_goods_anticipate_value (ant_id,sku_name,sku_id,spu_id,about_start_date,about_end_date,created_date,del_tag) VALUES(?,?,?,?,?,?,NOW(),0)
goblin_goods_anticipate_update=UPDATE goblin_goods_anticipate SET `name` = ?,`rule`= ? WHERE ant_id = ? goblin_goods_anticipate_update=UPDATE goblin_goods_anticipate SET `name` = ?,`rule`= ? WHERE ant_id = ?
goblin_goods_anticipate_update_proper=UPDATE goblin_goods_anticipate SET about_people = ? WHERE ant_id = ? goblin_goods_anticipate_update_proper=UPDATE goblin_goods_anticipate SET about_people = ? WHERE ant_id = ?
goblin_goods_anticipate_user=INSERT INTO goblin_goods_anticipate_user(uid,sku_id,phone,state) VALUES(?,?,?,?)
goblin_goods_anticipate_user_update=UPDATE goblin_goods_anticipate_user SET state = 0 WHERE uid = ? AND sku_id = ?
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment