|
@@ -17,6 +17,7 @@ import com.mokamrp.privates.mapper.pangu.pojo.PromoteQrcodePool;
|
|
|
import com.mokamrp.privates.mapper.pojo.User;
|
|
import com.mokamrp.privates.mapper.pojo.User;
|
|
|
import com.mokamrp.privates.service.pangu.PromoteQrcodePoolService;
|
|
import com.mokamrp.privates.service.pangu.PromoteQrcodePoolService;
|
|
|
import com.mokamrp.privates.utils.StringUtils;
|
|
import com.mokamrp.privates.utils.StringUtils;
|
|
|
|
|
+import com.mokamrp.privates.utils.sign.Aes;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.data.redis.core.StringRedisTemplate;
|
|
import org.springframework.data.redis.core.StringRedisTemplate;
|
|
|
import org.springframework.validation.BindingResult;
|
|
import org.springframework.validation.BindingResult;
|
|
@@ -56,12 +57,12 @@ public class PromoteCodeController extends BaseController<PromoteCode> {
|
|
|
* 如果需要定制化,需要将BaseController中对应的方法复制到当前控制器,然后进行修改
|
|
* 如果需要定制化,需要将BaseController中对应的方法复制到当前控制器,然后进行修改
|
|
|
*/
|
|
*/
|
|
|
@PostMapping("/list")
|
|
@PostMapping("/list")
|
|
|
- public Object list(@RequestBody PromoteCodeListHandle promoteCodeListHandle,@AuthUser User authUser) {
|
|
|
|
|
|
|
+ public Object list(@RequestBody PromoteCodeListHandle promoteCodeListHandle, @AuthUser User authUser) {
|
|
|
Object res;
|
|
Object res;
|
|
|
- if (authUser.getIsSuperAdmin().equals(1)){
|
|
|
|
|
- res = promoteCodeService.getlist(promoteCodeListHandle,null);
|
|
|
|
|
- }else{
|
|
|
|
|
- res = promoteCodeService.getlist(promoteCodeListHandle,authUser.getDepartment());
|
|
|
|
|
|
|
+ if (authUser.getIsSuperAdmin().equals(1)) {
|
|
|
|
|
+ res = promoteCodeService.getlist(promoteCodeListHandle, null);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ res = promoteCodeService.getlist(promoteCodeListHandle, authUser.getDepartment());
|
|
|
}
|
|
}
|
|
|
return AjaxResult.success(res);
|
|
return AjaxResult.success(res);
|
|
|
}
|
|
}
|
|
@@ -84,10 +85,10 @@ public class PromoteCodeController extends BaseController<PromoteCode> {
|
|
|
this.onInsert(addHandle.getRaw());
|
|
this.onInsert(addHandle.getRaw());
|
|
|
addHandle.getRaw().setDeptId(authUser.getDepartment());
|
|
addHandle.getRaw().setDeptId(authUser.getDepartment());
|
|
|
Boolean res = promoteCodeService.save(addHandle.getRaw());
|
|
Boolean res = promoteCodeService.save(addHandle.getRaw());
|
|
|
- if (res){
|
|
|
|
|
|
|
+ if (res) {
|
|
|
this.sync();
|
|
this.sync();
|
|
|
return AjaxResult.success(Constants.SUCCESS, res);
|
|
return AjaxResult.success(Constants.SUCCESS, res);
|
|
|
- }else{
|
|
|
|
|
|
|
+ } else {
|
|
|
return AjaxResult.error("新增失败");
|
|
return AjaxResult.error("新增失败");
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -101,7 +102,7 @@ public class PromoteCodeController extends BaseController<PromoteCode> {
|
|
|
String[] ids = delHandle.getIds().split(",");
|
|
String[] ids = delHandle.getIds().split(",");
|
|
|
QueryWrapper.in("id", ids);
|
|
QueryWrapper.in("id", ids);
|
|
|
boolean res = service.remove(QueryWrapper);
|
|
boolean res = service.remove(QueryWrapper);
|
|
|
- promoteQrcodePoolService.remove(new QueryWrapper<PromoteQrcodePool>().in("promote_id",ids));
|
|
|
|
|
|
|
+ promoteQrcodePoolService.remove(new QueryWrapper<PromoteQrcodePool>().in("promote_id", ids));
|
|
|
if (!res) {
|
|
if (!res) {
|
|
|
return AjaxResult.error("删除失败");
|
|
return AjaxResult.error("删除失败");
|
|
|
}
|
|
}
|
|
@@ -114,15 +115,15 @@ public class PromoteCodeController extends BaseController<PromoteCode> {
|
|
|
if (bindingResult.hasErrors()) {
|
|
if (bindingResult.hasErrors()) {
|
|
|
return AjaxResult.error(HttpStatus.ERROR, bindingResult.getFieldError().getDefaultMessage());
|
|
return AjaxResult.error(HttpStatus.ERROR, bindingResult.getFieldError().getDefaultMessage());
|
|
|
}
|
|
}
|
|
|
- if (editHandle.getRaw().getHourUvMax() != null){
|
|
|
|
|
|
|
+ if (editHandle.getRaw().getHourUvMax() != null) {
|
|
|
PromoteQrcodePool save = new PromoteQrcodePool();
|
|
PromoteQrcodePool save = new PromoteQrcodePool();
|
|
|
save.setHourUvMax(editHandle.getRaw().getHourUvMax());
|
|
save.setHourUvMax(editHandle.getRaw().getHourUvMax());
|
|
|
- promoteQrcodePoolService.update(save,new QueryWrapper<PromoteQrcodePool>().eq("promote_id",editHandle.getIds()));
|
|
|
|
|
|
|
+ promoteQrcodePoolService.update(save, new QueryWrapper<PromoteQrcodePool>().eq("promote_id", editHandle.getIds()));
|
|
|
}
|
|
}
|
|
|
- if (editHandle.getRaw().getDayUvMax() != null){
|
|
|
|
|
|
|
+ if (editHandle.getRaw().getDayUvMax() != null) {
|
|
|
PromoteQrcodePool save = new PromoteQrcodePool();
|
|
PromoteQrcodePool save = new PromoteQrcodePool();
|
|
|
save.setDayUvMax(editHandle.getRaw().getDayUvMax());
|
|
save.setDayUvMax(editHandle.getRaw().getDayUvMax());
|
|
|
- promoteQrcodePoolService.update(save,new QueryWrapper<PromoteQrcodePool>().eq("promote_id",editHandle.getIds()));
|
|
|
|
|
|
|
+ promoteQrcodePoolService.update(save, new QueryWrapper<PromoteQrcodePool>().eq("promote_id", editHandle.getIds()));
|
|
|
}
|
|
}
|
|
|
this.onUpdate(editHandle);
|
|
this.onUpdate(editHandle);
|
|
|
service.update(editHandle.getRaw(), new QueryWrapper<PromoteCode>().in("id", editHandle.getIds()));
|
|
service.update(editHandle.getRaw(), new QueryWrapper<PromoteCode>().in("id", editHandle.getIds()));
|
|
@@ -143,12 +144,11 @@ public class PromoteCodeController extends BaseController<PromoteCode> {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
|
- public Boolean delRedis(String[] ids){
|
|
|
|
|
- for (String id : ids){
|
|
|
|
|
- stringRedisTemplate.opsForHash().delete(RedisKey.PanPromoteCodeInfo,id);
|
|
|
|
|
- stringRedisTemplate.delete(RedisKey.PanCustServiceIdView+id);
|
|
|
|
|
- stringRedisTemplate.delete(RedisKey.PanCustServiceIdDayView+id);
|
|
|
|
|
|
|
+ public Boolean delRedis(String[] ids) {
|
|
|
|
|
+ for (String id : ids) {
|
|
|
|
|
+ stringRedisTemplate.opsForHash().delete(RedisKey.PanPromoteCodeInfo, id);
|
|
|
|
|
+ stringRedisTemplate.delete(RedisKey.PanCustServiceIdView + id);
|
|
|
|
|
+ stringRedisTemplate.delete(RedisKey.PanCustServiceIdDayView + id);
|
|
|
}
|
|
}
|
|
|
return true;
|
|
return true;
|
|
|
}
|
|
}
|