| @@ -11,8 +11,8 @@ import io.swagger.annotations.Api; | |||||
| import io.swagger.annotations.ApiImplicitParam; | import io.swagger.annotations.ApiImplicitParam; | ||||
| import io.swagger.annotations.ApiImplicitParams; | import io.swagger.annotations.ApiImplicitParams; | ||||
| import io.swagger.annotations.ApiOperation; | import io.swagger.annotations.ApiOperation; | ||||
| import org.apache.commons.lang3.StringUtils; | |||||
| import org.apache.log4j.Logger; | |||||
| import org.slf4j.Logger; | |||||
| import org.slf4j.LoggerFactory; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.web.bind.annotation.*; | import org.springframework.web.bind.annotation.*; | ||||
| @@ -23,36 +23,35 @@ import java.util.List; | |||||
| @Api(description = "精准投放接口") | @Api(description = "精准投放接口") | ||||
| @RestController | @RestController | ||||
| @RequestMapping("couponInject") | @RequestMapping("couponInject") | ||||
| public class CouponInjectController extends BaseController | |||||
| { | |||||
| @Autowired | |||||
| public class CouponInjectController extends BaseController { | |||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||||
| @Autowired | |||||
| private CouponInjectService couponInjectService; | private CouponInjectService couponInjectService; | ||||
| @Autowired | |||||
| @Autowired | |||||
| private WxCUserTagsService wxCUserTagsService; | private WxCUserTagsService wxCUserTagsService; | ||||
| private Logger logger = Logger.getLogger(CouponInjectController.class); | |||||
| @ApiOperation("分页列表接口") | |||||
| @ApiOperation("分页列表接口") | |||||
| @GetMapping("list") | @GetMapping("list") | ||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name="pageNum",value="页数",dataType="int", paramType = "query",required=true), | |||||
| @ApiImplicitParam(name="pageSize",value="每页条数",dataType="int", paramType = "query",required=true)}) | |||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | |||||
| public ResultData list(@ModelAttribute CouponInject couponInject, Integer pageNum, Integer pageSize) { | public ResultData list(@ModelAttribute CouponInject couponInject, Integer pageNum, Integer pageSize) { | ||||
| if (null == couponInject) couponInject = new CouponInject(); | |||||
| if(couponInject.getStatus()!=null&&couponInject.getStatus()==-1){ | |||||
| if (null == couponInject) couponInject = new CouponInject(); | |||||
| if (couponInject.getStatus() != null && couponInject.getStatus() == -1) { | |||||
| couponInject.setStatus(null); | couponInject.setStatus(null); | ||||
| } | } | ||||
| final PageInfo<CouponInject> page = couponInjectService.listAsPage(couponInject, pageNum, pageSize); | final PageInfo<CouponInject> page = couponInjectService.listAsPage(couponInject, pageNum, pageSize); | ||||
| return new ResultData(page); | return new ResultData(page); | ||||
| } | } | ||||
| @ApiOperation("新增接口") | |||||
| @ApiOperation("新增接口") | |||||
| @PostMapping("add") | @PostMapping("add") | ||||
| public ResultData add(@RequestBody CouponInject couponInject) { | public ResultData add(@RequestBody CouponInject couponInject) { | ||||
| couponInject.setTenantId(getUser().getTenantId()); | couponInject.setTenantId(getUser().getTenantId()); | ||||
| couponInject.setMUserId(getUser().getId()); | couponInject.setMUserId(getUser().getId()); | ||||
| if(couponInject.getSendType()==0){ | |||||
| if (couponInject.getSendType() == 0) { | |||||
| couponInject.setSendTime(new Date()); | couponInject.setSendTime(new Date()); | ||||
| } | } | ||||
| //Assert.notNull(couponInject.getName(), "角色名不能为空"); | //Assert.notNull(couponInject.getName(), "角色名不能为空"); | ||||
| @@ -75,25 +74,24 @@ public class CouponInjectController extends BaseController | |||||
| @ApiOperation("根据id删除接口") | @ApiOperation("根据id删除接口") | ||||
| @GetMapping("/del") | @GetMapping("/del") | ||||
| @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | |||||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | |||||
| public ResultData delete(Long id) { | public ResultData delete(Long id) { | ||||
| couponInjectService.deleteById(id); | couponInjectService.deleteById(id); | ||||
| return new ResultData(Result.SUCCESS, "删除成功", null); | return new ResultData(Result.SUCCESS, "删除成功", null); | ||||
| } | } | ||||
| @ApiOperation("根据id查询接口") | |||||
| @GetMapping("/findById") | |||||
| @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | |||||
| @ApiOperation("根据id查询接口") | |||||
| @GetMapping("/findById") | |||||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | |||||
| public ResultData findById(Long id) { | public ResultData findById(Long id) { | ||||
| CouponInject couponInject = couponInjectService.getById(id); | CouponInject couponInject = couponInjectService.getById(id); | ||||
| if(couponInject!=null) { | |||||
| if (couponInject != null) { | |||||
| List<Long> tagids = JSON.parseArray(couponInject.getTags(), Long.class); | List<Long> tagids = JSON.parseArray(couponInject.getTags(), Long.class); | ||||
| couponInject.setWxChooseTagVo(wxCUserTagsService.findChooseTag(tagids)); | couponInject.setWxChooseTagVo(wxCUserTagsService.findChooseTag(tagids)); | ||||
| } | } | ||||
| return new ResultData(Result.SUCCESS,"查询成功",couponInject); | |||||
| return new ResultData(Result.SUCCESS, "查询成功", couponInject); | |||||
| } | } | ||||
| } | } | ||||
| @@ -4,7 +4,8 @@ import com.simple.common.ResultData; | |||||
| import com.simple.service.DataTowerService; | import com.simple.service.DataTowerService; | ||||
| import io.swagger.annotations.Api; | import io.swagger.annotations.Api; | ||||
| import io.swagger.annotations.ApiOperation; | import io.swagger.annotations.ApiOperation; | ||||
| import org.apache.log4j.Logger; | |||||
| import org.slf4j.Logger; | |||||
| import org.slf4j.LoggerFactory; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.web.bind.annotation.PostMapping; | import org.springframework.web.bind.annotation.PostMapping; | ||||
| import org.springframework.web.bind.annotation.RequestMapping; | import org.springframework.web.bind.annotation.RequestMapping; | ||||
| @@ -17,8 +18,7 @@ import java.util.Map; | |||||
| @RequestMapping("datatower") | @RequestMapping("datatower") | ||||
| public class DataTowerController extends BaseController { | public class DataTowerController extends BaseController { | ||||
| private Logger logger = Logger.getLogger(DataTowerController.class); | |||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||||
| @Autowired | @Autowired | ||||
| private DataTowerService dataTowerService; | private DataTowerService dataTowerService; | ||||
| @@ -28,7 +28,7 @@ public class DataTowerController extends BaseController { | |||||
| @PostMapping("/queryRunning") | @PostMapping("/queryRunning") | ||||
| public ResultData queryRunning() { | public ResultData queryRunning() { | ||||
| Map<String,Object> data=dataTowerService.queryRunning(getTenantId()); | |||||
| Map<String, Object> data = dataTowerService.queryRunning(getTenantId()); | |||||
| return new ResultData(data); | return new ResultData(data); | ||||
| } | } | ||||
| @@ -38,7 +38,7 @@ public class DataTowerController extends BaseController { | |||||
| @PostMapping("/queryCar") | @PostMapping("/queryCar") | ||||
| public ResultData queryCar() { | public ResultData queryCar() { | ||||
| Map<String,Object> data=dataTowerService.queryCar(getTenantId()); | |||||
| Map<String, Object> data = dataTowerService.queryCar(getTenantId()); | |||||
| return new ResultData(data); | return new ResultData(data); | ||||
| } | } | ||||
| @@ -47,7 +47,7 @@ public class DataTowerController extends BaseController { | |||||
| @PostMapping("/queryCustomer") | @PostMapping("/queryCustomer") | ||||
| public ResultData queryCustomer() { | public ResultData queryCustomer() { | ||||
| Map<String,Object> data=dataTowerService.queryCustomer(getTenantId()); | |||||
| Map<String, Object> data = dataTowerService.queryCustomer(getTenantId()); | |||||
| return new ResultData(data); | return new ResultData(data); | ||||
| } | } | ||||
| @@ -1,15 +1,5 @@ | |||||
| package com.simple.controller; | package com.simple.controller; | ||||
| import org.apache.shiro.SecurityUtils; | |||||
| import org.apache.shiro.authc.UsernamePasswordToken; | |||||
| import org.apache.shiro.subject.Subject; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.util.StringUtils; | |||||
| import org.springframework.web.bind.annotation.GetMapping; | |||||
| import org.springframework.web.bind.annotation.PostMapping; | |||||
| import org.springframework.web.bind.annotation.RequestBody; | |||||
| import org.springframework.web.bind.annotation.RestController; | |||||
| import com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| import com.simple.common.ResultData; | import com.simple.common.ResultData; | ||||
| import com.simple.domain.po.MallRolePermission; | import com.simple.domain.po.MallRolePermission; | ||||
| @@ -18,44 +8,44 @@ import com.simple.domain.po.MallUserRole; | |||||
| import com.simple.service.MallRolePermissionService; | import com.simple.service.MallRolePermissionService; | ||||
| import com.simple.service.MallUserRoleService; | import com.simple.service.MallUserRoleService; | ||||
| import com.simple.shiro.UserSession; | import com.simple.shiro.UserSession; | ||||
| import io.swagger.annotations.Api; | import io.swagger.annotations.Api; | ||||
| import io.swagger.annotations.ApiOperation; | import io.swagger.annotations.ApiOperation; | ||||
| import org.apache.shiro.SecurityUtils; | |||||
| import org.apache.shiro.authc.UsernamePasswordToken; | |||||
| import org.apache.shiro.subject.Subject; | |||||
| import org.slf4j.Logger; | |||||
| import org.slf4j.LoggerFactory; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.util.StringUtils; | |||||
| import org.springframework.web.bind.annotation.GetMapping; | |||||
| import org.springframework.web.bind.annotation.PostMapping; | |||||
| import org.springframework.web.bind.annotation.RequestBody; | |||||
| import org.springframework.web.bind.annotation.RestController; | |||||
| @RestController | @RestController | ||||
| @Api(description="登录相关接口") | |||||
| @Api(description = "登录相关接口") | |||||
| public class HomeController { | public class HomeController { | ||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||||
| // @Autowired | |||||
| // private MallRoleService sysRoleService; | |||||
| // | |||||
| // @Autowired | |||||
| // private MallPermissionService sysPermissionService; | |||||
| @Autowired | @Autowired | ||||
| private MallUserRoleService mallUserRoleService; | private MallUserRoleService mallUserRoleService; | ||||
| @Autowired | @Autowired | ||||
| private MallRolePermissionService mallRolePermissionService; | private MallRolePermissionService mallRolePermissionService; | ||||
| // @GetMapping("login") | |||||
| // public ResultData login() { | |||||
| // return new ResultData(Result.UNLOGIN, "用户未登录"); | |||||
| // } | |||||
| @ApiOperation("登录") | @ApiOperation("登录") | ||||
| @PostMapping("/doLogin") | @PostMapping("/doLogin") | ||||
| public ResultData login(@RequestBody MallUserInfo user) { | public ResultData login(@RequestBody MallUserInfo user) { | ||||
| ResultData data = new ResultData(); | |||||
| ResultData data = new ResultData(); | |||||
| if (StringUtils.isEmpty(user.getUsername()) || StringUtils.isEmpty(user.getPassword())) { | if (StringUtils.isEmpty(user.getUsername()) || StringUtils.isEmpty(user.getPassword())) { | ||||
| // throw new SystemException(ErrorCode.LOGIN_USER_OR_PWD_ERROR); | // throw new SystemException(ErrorCode.LOGIN_USER_OR_PWD_ERROR); | ||||
| return new ResultData(ResultData.ERROR,"用户名或者密码错误"); | |||||
| return new ResultData(ResultData.ERROR, "用户名或者密码错误"); | |||||
| } | } | ||||
| try { | try { | ||||
| Subject subject = SecurityUtils.getSubject(); | |||||
| UsernamePasswordToken token = new UsernamePasswordToken(user.getUsername(), user.getPassword()); | |||||
| subject.login(token); | |||||
| Subject subject = SecurityUtils.getSubject(); | |||||
| UsernamePasswordToken token = new UsernamePasswordToken(user.getUsername(), user.getPassword()); | |||||
| subject.login(token); | |||||
| // List<MallRole> roleList = sysRoleService.findRoleByUserId(user.getId()); | // List<MallRole> roleList = sysRoleService.findRoleByUserId(user.getId()); | ||||
| // if (null != roleList && roleList.size() > 0) { | // if (null != roleList && roleList.size() > 0) { | ||||
| // List<MallPermission> permissionList = sysPermissionService | // List<MallPermission> permissionList = sysPermissionService | ||||
| @@ -63,33 +53,34 @@ public class HomeController { | |||||
| // user.setRole(roleList); | // user.setRole(roleList); | ||||
| // user.setPermission(permissionList); | // user.setPermission(permissionList); | ||||
| // } | // } | ||||
| MallUserInfo info =(MallUserInfo) SecurityUtils.getSubject().getSession().getAttribute(UserSession.userInfo); | |||||
| MallUserInfo info = (MallUserInfo) SecurityUtils.getSubject().getSession().getAttribute(UserSession.userInfo); | |||||
| info.setPassword("保密"); | info.setPassword("保密"); | ||||
| // System.out.println("id:"+ SecurityUtils.getSubject().getSession().getId()); | // System.out.println("id:"+ SecurityUtils.getSubject().getSession().getId()); | ||||
| MallUserRole ur = new MallUserRole(); | MallUserRole ur = new MallUserRole(); | ||||
| ur.setUid(info.getId()); | ur.setUid(info.getId()); | ||||
| PageInfo<MallUserRole> page = mallUserRoleService.listAsPage(ur, 1, 1); | PageInfo<MallUserRole> page = mallUserRoleService.listAsPage(ur, 1, 1); | ||||
| if(page.getSize()>0) { | |||||
| Long roleId = page.getList().get(0).getRoleId(); | |||||
| MallRolePermission p = new MallRolePermission(); | |||||
| p.setRoleId(roleId); | |||||
| p.setTenantId(info.getTenantId()); | |||||
| PageInfo<MallRolePermission> listAsPage = mallRolePermissionService.listAsPage(p, 1, 100); | |||||
| String menus = ""; | |||||
| for(MallRolePermission rp :listAsPage.getList()) { | |||||
| menus+=rp.getPermissionId()+","; | |||||
| } | |||||
| if(menus.length()>0) { | |||||
| menus = menus.substring(0, menus.length()-1); | |||||
| } | |||||
| info.setMenus(menus); | |||||
| if (page.getSize() > 0) { | |||||
| Long roleId = page.getList().get(0).getRoleId(); | |||||
| MallRolePermission p = new MallRolePermission(); | |||||
| p.setRoleId(roleId); | |||||
| p.setTenantId(info.getTenantId()); | |||||
| PageInfo<MallRolePermission> listAsPage = mallRolePermissionService.listAsPage(p, 1, 100); | |||||
| String menus = ""; | |||||
| for (MallRolePermission rp : listAsPage.getList()) { | |||||
| menus += rp.getPermissionId() + ","; | |||||
| } | |||||
| if (menus.length() > 0) { | |||||
| menus = menus.substring(0, menus.length() - 1); | |||||
| } | |||||
| info.setMenus(menus); | |||||
| } | } | ||||
| data.data=info; | |||||
| }catch(Exception e) { | |||||
| return new ResultData(ResultData.ERROR,"用户名或者密码错误"); | |||||
| data.data = info; | |||||
| } catch (Exception e) { | |||||
| return new ResultData(ResultData.ERROR, "用户名或者密码错误"); | |||||
| } | } | ||||
| return data; | return data; | ||||
| } | } | ||||
| @ApiOperation("登出") | @ApiOperation("登出") | ||||
| @GetMapping("/logout") | @GetMapping("/logout") | ||||
| public ResultData login() { | public ResultData login() { | ||||
| @@ -1,18 +1,19 @@ | |||||
| package com.simple.controller; | package com.simple.controller; | ||||
| import com.github.pagehelper.PageInfo; | |||||
| import com.simple.common.Result; | |||||
| import com.simple.common.ResultData; | |||||
| import com.simple.domain.po.MallPermission; | |||||
| import com.simple.service.MallPermissionService; | |||||
| import org.apache.shiro.util.Assert; | import org.apache.shiro.util.Assert; | ||||
| import org.slf4j.Logger; | |||||
| import org.slf4j.LoggerFactory; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.web.bind.annotation.GetMapping; | import org.springframework.web.bind.annotation.GetMapping; | ||||
| import org.springframework.web.bind.annotation.PostMapping; | import org.springframework.web.bind.annotation.PostMapping; | ||||
| import org.springframework.web.bind.annotation.RequestMapping; | import org.springframework.web.bind.annotation.RequestMapping; | ||||
| import org.springframework.web.bind.annotation.RestController; | import org.springframework.web.bind.annotation.RestController; | ||||
| import com.github.pagehelper.PageInfo; | |||||
| import com.simple.common.Result; | |||||
| import com.simple.common.ResultData; | |||||
| import com.simple.domain.po.MallPermission; | |||||
| import com.simple.service.MallPermissionService; | |||||
| /** | /** | ||||
| * @author chenkx | * @author chenkx | ||||
| * @date 2018-01-05. | * @date 2018-01-05. | ||||
| @@ -20,16 +21,17 @@ import com.simple.service.MallPermissionService; | |||||
| @RestController | @RestController | ||||
| @RequestMapping("permission") | @RequestMapping("permission") | ||||
| public class MallPermissionController { | public class MallPermissionController { | ||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||||
| @Autowired | @Autowired | ||||
| MallPermissionService mallPermissionService; | MallPermissionService mallPermissionService; | ||||
| @GetMapping("alllist") | @GetMapping("alllist") | ||||
| public ResultData alllist(String ava) { | public ResultData alllist(String ava) { | ||||
| MallPermission record = new MallPermission(); | MallPermission record = new MallPermission(); | ||||
| record.setAvailable(ava); | |||||
| PageInfo<MallPermission> permissions= mallPermissionService.listAsPage(record, 1, 10000); | |||||
| record.setAvailable(ava); | |||||
| PageInfo<MallPermission> permissions = mallPermissionService.listAsPage(record, 1, 10000); | |||||
| return new ResultData(Result.SUCCESS, "查询成功", permissions.getList()); | return new ResultData(Result.SUCCESS, "查询成功", permissions.getList()); | ||||
| } | } | ||||
| @@ -51,7 +53,7 @@ public class MallPermissionController { | |||||
| mallPermissionService.deleteById(id); | mallPermissionService.deleteById(id); | ||||
| return new ResultData(Result.SUCCESS, "删除成功", null); | return new ResultData(Result.SUCCESS, "删除成功", null); | ||||
| } | } | ||||
| @GetMapping("/findById") | @GetMapping("/findById") | ||||
| public ResultData findById(Long id) { | public ResultData findById(Long id) { | ||||
| mallPermissionService.getById(id); | mallPermissionService.getById(id); | ||||
| @@ -1,18 +1,5 @@ | |||||
| package com.simple.controller; | package com.simple.controller; | ||||
| import java.util.ArrayList; | |||||
| import java.util.List; | |||||
| import org.apache.commons.lang3.StringUtils; | |||||
| import org.apache.log4j.Logger; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.util.Assert; | |||||
| import org.springframework.web.bind.annotation.GetMapping; | |||||
| 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 com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| import com.simple.common.Result; | import com.simple.common.Result; | ||||
| import com.simple.common.ResultData; | import com.simple.common.ResultData; | ||||
| @@ -20,16 +7,24 @@ import com.simple.domain.po.MallRole; | |||||
| import com.simple.domain.po.MallRolePermission; | import com.simple.domain.po.MallRolePermission; | ||||
| import com.simple.service.MallRolePermissionService; | import com.simple.service.MallRolePermissionService; | ||||
| import com.simple.service.MallRoleService; | import com.simple.service.MallRoleService; | ||||
| import io.swagger.annotations.Api; | import io.swagger.annotations.Api; | ||||
| import org.apache.commons.lang3.StringUtils; | |||||
| import org.slf4j.Logger; | |||||
| import org.slf4j.LoggerFactory; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.util.Assert; | |||||
| import org.springframework.web.bind.annotation.*; | |||||
| import java.util.ArrayList; | |||||
| import java.util.List; | |||||
| @RestController | @RestController | ||||
| @RequestMapping("role") | @RequestMapping("role") | ||||
| @Api(description="角色相关接口") | |||||
| @Api(description = "角色相关接口") | |||||
| public class MallRoleController extends BaseController { | public class MallRoleController extends BaseController { | ||||
| private Logger logger = Logger.getLogger(MallRoleController.class); | |||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||||
| @Autowired | @Autowired | ||||
| private MallRoleService sysRoleService; | private MallRoleService sysRoleService; | ||||
| @@ -39,47 +34,48 @@ public class MallRoleController extends BaseController { | |||||
| @GetMapping("list") | @GetMapping("list") | ||||
| public ResultData list(MallRole sysRole, Integer pageNum, Integer pageSize) { | public ResultData list(MallRole sysRole, Integer pageNum, Integer pageSize) { | ||||
| String tenantId = getTenantId(); | |||||
| sysRole.setTenantId(tenantId); | |||||
| String tenantId = getTenantId(); | |||||
| sysRole.setTenantId(tenantId); | |||||
| final PageInfo<MallRole> page = sysRoleService.listAsPage(sysRole, pageNum, pageSize); | final PageInfo<MallRole> page = sysRoleService.listAsPage(sysRole, pageNum, pageSize); | ||||
| for(MallRole r:page.getList()) { | |||||
| MallRolePermission p = new MallRolePermission(); | |||||
| p.setRoleId(r.getId()); | |||||
| p.setTenantId(tenantId); | |||||
| PageInfo<MallRolePermission> pers = sysRolePermissionService.listAsPage(p, 1, 1000); | |||||
| String menus =""; | |||||
| for(MallRolePermission rp:pers.getList()) { | |||||
| menus+=rp.getPermissionId()+","; | |||||
| } | |||||
| if(menus.length()>1) { | |||||
| menus=menus.substring(0, menus.length()-1); | |||||
| } | |||||
| r.setMenus(menus); | |||||
| for (MallRole r : page.getList()) { | |||||
| MallRolePermission p = new MallRolePermission(); | |||||
| p.setRoleId(r.getId()); | |||||
| p.setTenantId(tenantId); | |||||
| PageInfo<MallRolePermission> pers = sysRolePermissionService.listAsPage(p, 1, 1000); | |||||
| String menus = ""; | |||||
| for (MallRolePermission rp : pers.getList()) { | |||||
| menus += rp.getPermissionId() + ","; | |||||
| } | |||||
| if (menus.length() > 1) { | |||||
| menus = menus.substring(0, menus.length() - 1); | |||||
| } | |||||
| r.setMenus(menus); | |||||
| } | } | ||||
| return new ResultData(page); | return new ResultData(page); | ||||
| } | } | ||||
| @PostMapping("saveOrUpdate") | @PostMapping("saveOrUpdate") | ||||
| public ResultData saveOrUpdate(@RequestBody MallRole sysRole ) { | |||||
| String tenantId = getTenantId(); | |||||
| int count = sysRoleService.countByName(sysRole.getName(), sysRole.getId()); | |||||
| if(count>0) { | |||||
| return new ResultData(ResultData.ERROR,"角色名已存在"); | |||||
| } | |||||
| sysRole.setTenantId(tenantId); | |||||
| sysRoleService.saveOrUpdate(sysRole); | |||||
| public ResultData saveOrUpdate(@RequestBody MallRole sysRole) { | |||||
| String tenantId = getTenantId(); | |||||
| int count = sysRoleService.countByName(sysRole.getName(), sysRole.getId()); | |||||
| if (count > 0) { | |||||
| return new ResultData(ResultData.ERROR, "角色名已存在"); | |||||
| } | |||||
| sysRole.setTenantId(tenantId); | |||||
| sysRoleService.saveOrUpdate(sysRole); | |||||
| // SysRolePermissionService.deleteById(id); | // SysRolePermissionService.deleteById(id); | ||||
| if(StringUtils.isNoneBlank(sysRole.getMenus())) { | |||||
| List<Long> mIds =new ArrayList<>(); | |||||
| for(String mId:sysRole.getMenus().split(",")) { | |||||
| mIds.add(Long.valueOf(mId)); | |||||
| } | |||||
| sysRolePermissionService.savePermissions(tenantId,sysRole.getId(), mIds.toArray(new Long[] {}));; | |||||
| } | |||||
| return new ResultData(); | |||||
| if (StringUtils.isNoneBlank(sysRole.getMenus())) { | |||||
| List<Long> mIds = new ArrayList<>(); | |||||
| for (String mId : sysRole.getMenus().split(",")) { | |||||
| mIds.add(Long.valueOf(mId)); | |||||
| } | |||||
| sysRolePermissionService.savePermissions(tenantId, sysRole.getId(), mIds.toArray(new Long[]{})); | |||||
| ; | |||||
| } | |||||
| return new ResultData(); | |||||
| } | } | ||||
| @PostMapping("add") | @PostMapping("add") | ||||
| public ResultData add(MallRole sysRole) { | public ResultData add(MallRole sysRole) { | ||||
| @@ -92,15 +88,14 @@ public class MallRoleController extends BaseController { | |||||
| @PostMapping("update") | @PostMapping("update") | ||||
| public ResultData update(MallRole sysRole) { | public ResultData update(MallRole sysRole) { | ||||
| if (sysRole.getName() != null) { | if (sysRole.getName() != null) { | ||||
| System.out.println(checkUnique(sysRole.getName(), sysRole.getId())); | |||||
| System.out.println(checkUnique(sysRole.getName(), sysRole.getId())); | |||||
| Assert.isTrue(!checkUnique(sysRole.getName(), sysRole.getId()), "角色名已存在"); | Assert.isTrue(!checkUnique(sysRole.getName(), sysRole.getId()), "角色名已存在"); | ||||
| } | } | ||||
| sysRoleService.saveOrUpdate(sysRole); | sysRoleService.saveOrUpdate(sysRole); | ||||
| // Assert.notNull(sysRole.getName(), "角色名不能为空"); | // Assert.notNull(sysRole.getName(), "角色名不能为空"); | ||||
| return new ResultData(); | return new ResultData(); | ||||
| } | } | ||||
| @PostMapping("/del") | @PostMapping("/del") | ||||
| public ResultData delete(@RequestBody MallRole sysRole) { | public ResultData delete(@RequestBody MallRole sysRole) { | ||||
| @@ -111,10 +106,10 @@ public class MallRoleController extends BaseController { | |||||
| @GetMapping("setPermission") | @GetMapping("setPermission") | ||||
| public ResultData setPermission(Long roleId, String perId) { | public ResultData setPermission(Long roleId, String perId) { | ||||
| Assert.notNull(perId,"请选择权限"); | |||||
| Assert.notNull(perId, "请选择权限"); | |||||
| /*String[] perIds = perId.split(","); | /*String[] perIds = perId.split(","); | ||||
| SysRolePermissionService.savePermissions(roleId, perIds);*/ | SysRolePermissionService.savePermissions(roleId, perIds);*/ | ||||
| //TODO | |||||
| //TODO | |||||
| return new ResultData(Result.SUCCESS, "设置角色权限成功", null); | return new ResultData(Result.SUCCESS, "设置角色权限成功", null); | ||||
| } | } | ||||
| @@ -1,26 +1,22 @@ | |||||
| package com.simple.controller; | package com.simple.controller; | ||||
| import java.util.HashMap; | |||||
| import java.util.Map; | |||||
| import com.simple.domain.po.*; | |||||
| import com.simple.service.*; | |||||
| import org.apache.shiro.SecurityUtils; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.util.Assert; | |||||
| import org.springframework.web.bind.annotation.GetMapping; | |||||
| 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 com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| import com.simple.common.ResultData; | import com.simple.common.ResultData; | ||||
| import com.simple.domain.po.*; | |||||
| import com.simple.service.*; | |||||
| import com.simple.shiro.PasswordHelper; | import com.simple.shiro.PasswordHelper; | ||||
| import com.simple.shiro.UserSession; | import com.simple.shiro.UserSession; | ||||
| import io.swagger.annotations.Api; | import io.swagger.annotations.Api; | ||||
| import io.swagger.annotations.ApiOperation; | import io.swagger.annotations.ApiOperation; | ||||
| import org.apache.shiro.SecurityUtils; | |||||
| import org.slf4j.Logger; | |||||
| import org.slf4j.LoggerFactory; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.util.Assert; | |||||
| import org.springframework.web.bind.annotation.*; | |||||
| import java.util.HashMap; | |||||
| import java.util.Map; | |||||
| /** | /** | ||||
| * @author chenkx | * @author chenkx | ||||
| @@ -31,15 +27,17 @@ import io.swagger.annotations.ApiOperation; | |||||
| @RequestMapping("user") | @RequestMapping("user") | ||||
| public class MallUserInfoController extends BaseController { | public class MallUserInfoController extends BaseController { | ||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||||
| @Autowired | @Autowired | ||||
| MallUserInfoService userInfoService; | MallUserInfoService userInfoService; | ||||
| @Autowired | @Autowired | ||||
| MallUserRoleService userRoleService; | MallUserRoleService userRoleService; | ||||
| @Autowired | @Autowired | ||||
| MallRoleService mallRoleService; | MallRoleService mallRoleService; | ||||
| @Autowired | @Autowired | ||||
| MallUserRoleService mallUserRoleService; | MallUserRoleService mallUserRoleService; | ||||
| @@ -51,35 +49,35 @@ public class MallUserInfoController extends BaseController { | |||||
| @ApiOperation(value = "用户分页接口", response = String.class) | @ApiOperation(value = "用户分页接口", response = String.class) | ||||
| @GetMapping("lists") | @GetMapping("lists") | ||||
| public ResultData listAsPage(MallUserInfo userInfo, Integer pageNum, Integer pageSize){ | |||||
| public ResultData listAsPage(MallUserInfo userInfo, Integer pageNum, Integer pageSize) { | |||||
| userInfo.setTenantId(getTenantId()); | userInfo.setTenantId(getTenantId()); | ||||
| final PageInfo<MallUserInfo> page = userInfoService.listAsPage(userInfo, pageNum, pageSize); | final PageInfo<MallUserInfo> page = userInfoService.listAsPage(userInfo, pageNum, pageSize); | ||||
| for(MallUserInfo u:page.getList()) { | |||||
| MallUserRole r =new MallUserRole(); | |||||
| r.setUid(u.getId()); | |||||
| PageInfo<MallUserRole> ur = userRoleService.listAsPage(r, 1, 1); | |||||
| if(ur.getSize()>0) { | |||||
| MallRole role = mallRoleService.getById(ur.getList().get(0).getRoleId()); | |||||
| if (role != null) { | |||||
| for (MallUserInfo u : page.getList()) { | |||||
| MallUserRole r = new MallUserRole(); | |||||
| r.setUid(u.getId()); | |||||
| PageInfo<MallUserRole> ur = userRoleService.listAsPage(r, 1, 1); | |||||
| if (ur.getSize() > 0) { | |||||
| MallRole role = mallRoleService.getById(ur.getList().get(0).getRoleId()); | |||||
| if (role != null) { | |||||
| u.setRoleName(role.getName()); | u.setRoleName(role.getName()); | ||||
| u.setRoleId(role.getId()); | u.setRoleId(role.getId()); | ||||
| } | } | ||||
| } | |||||
| u.setPassword(null);//不返回密码 | |||||
| } | |||||
| u.setPassword(null);//不返回密码 | |||||
| } | } | ||||
| return new ResultData(page); | return new ResultData(page); | ||||
| } | } | ||||
| @ApiOperation(value = "用户详情接口", response = String.class) | @ApiOperation(value = "用户详情接口", response = String.class) | ||||
| @GetMapping("detail") | @GetMapping("detail") | ||||
| public ResultData detail(Long id){ | |||||
| public ResultData detail(Long id) { | |||||
| final MallUserInfo user = userInfoService.getById(id); | final MallUserInfo user = userInfoService.getById(id); | ||||
| return new ResultData(user); | return new ResultData(user); | ||||
| } | } | ||||
| @ApiOperation(value = "创建用户接口", response = String.class) | @ApiOperation(value = "创建用户接口", response = String.class) | ||||
| @PostMapping("add") | @PostMapping("add") | ||||
| public ResultData createUser(@RequestBody MallUserInfo userInfo){ | |||||
| public ResultData createUser(@RequestBody MallUserInfo userInfo) { | |||||
| Assert.notNull(userInfo.getUsername(), "用户名不能为空"); | Assert.notNull(userInfo.getUsername(), "用户名不能为空"); | ||||
| Assert.isTrue(checkUnique(userInfo.getUsername(), 0), "重复的用户名"); | Assert.isTrue(checkUnique(userInfo.getUsername(), 0), "重复的用户名"); | ||||
| Assert.notNull(userInfo.getPassword(), "密码不能为空"); | Assert.notNull(userInfo.getPassword(), "密码不能为空"); | ||||
| @@ -87,18 +85,18 @@ public class MallUserInfoController extends BaseController { | |||||
| passwordHelper.encryptPassword(userInfo); | passwordHelper.encryptPassword(userInfo); | ||||
| userInfo.setTenantId(getTenantId()); | userInfo.setTenantId(getTenantId()); | ||||
| userInfoService.saveOrUpdate(userInfo); | userInfoService.saveOrUpdate(userInfo); | ||||
| if(userInfo.getRoleId()!=null) { | |||||
| MallUserRole r = new MallUserRole(); | |||||
| r.setRoleId(userInfo.getRoleId()); | |||||
| r.setUid(userInfo.getId()); | |||||
| userRoleService.saveOrUpdate(r); | |||||
| if (userInfo.getRoleId() != null) { | |||||
| MallUserRole r = new MallUserRole(); | |||||
| r.setRoleId(userInfo.getRoleId()); | |||||
| r.setUid(userInfo.getId()); | |||||
| userRoleService.saveOrUpdate(r); | |||||
| } | } | ||||
| return new ResultData(); | return new ResultData(); | ||||
| } | } | ||||
| @ApiOperation(value = "修改用户接口", response = String.class) | @ApiOperation(value = "修改用户接口", response = String.class) | ||||
| @PostMapping("update") | @PostMapping("update") | ||||
| public ResultData updateUser(@RequestBody MallUserInfo userInfo){ | |||||
| public ResultData updateUser(@RequestBody MallUserInfo userInfo) { | |||||
| Assert.notNull(userInfo.getUsername(), "用户名不能为空"); | Assert.notNull(userInfo.getUsername(), "用户名不能为空"); | ||||
| Assert.isTrue(checkUnique(userInfo.getUsername(), 1), "重复的用户名"); | Assert.isTrue(checkUnique(userInfo.getUsername(), 1), "重复的用户名"); | ||||
| // Assert.notNull(userInfo.getPassword(), "密码不能为空"); | // Assert.notNull(userInfo.getPassword(), "密码不能为空"); | ||||
| @@ -107,12 +105,12 @@ public class MallUserInfoController extends BaseController { | |||||
| userInfo.setPassword(null); | userInfo.setPassword(null); | ||||
| userInfo.setTenantId(getTenantId()); | userInfo.setTenantId(getTenantId()); | ||||
| userInfoService.saveOrUpdate(userInfo); | userInfoService.saveOrUpdate(userInfo); | ||||
| if(userInfo.getRoleId()!=null) { | |||||
| userRoleService.deleteByUserId(userInfo.getId()); | |||||
| MallUserRole r = new MallUserRole(); | |||||
| r.setRoleId(userInfo.getRoleId()); | |||||
| r.setUid(userInfo.getId()); | |||||
| userRoleService.saveOrUpdate(r); | |||||
| if (userInfo.getRoleId() != null) { | |||||
| userRoleService.deleteByUserId(userInfo.getId()); | |||||
| MallUserRole r = new MallUserRole(); | |||||
| r.setRoleId(userInfo.getRoleId()); | |||||
| r.setUid(userInfo.getId()); | |||||
| userRoleService.saveOrUpdate(r); | |||||
| } | } | ||||
| return new ResultData(); | return new ResultData(); | ||||
| } | } | ||||
| @@ -121,12 +119,13 @@ public class MallUserInfoController extends BaseController { | |||||
| @PostMapping("/del") | @PostMapping("/del") | ||||
| public ResultData deleteUser(@RequestBody MallUserInfo userInfo) { | public ResultData deleteUser(@RequestBody MallUserInfo userInfo) { | ||||
| userInfoService.deleteById(userInfo.getId()); | userInfoService.deleteById(userInfo.getId()); | ||||
| return new ResultData(); | return new ResultData(); | ||||
| } | } | ||||
| /** | /** | ||||
| * 启用,停用用户 | * 启用,停用用户 | ||||
| * | |||||
| * @param userId | * @param userId | ||||
| * @param status | * @param status | ||||
| * @return | * @return | ||||
| @@ -143,7 +142,7 @@ public class MallUserInfoController extends BaseController { | |||||
| @ApiOperation(value = "用户添加角色接口", response = String.class) | @ApiOperation(value = "用户添加角色接口", response = String.class) | ||||
| @PostMapping("setRoles") | @PostMapping("setRoles") | ||||
| public ResultData setRoles(Long userId,String roleIds) { | |||||
| public ResultData setRoles(Long userId, String roleIds) { | |||||
| /*String[] roIds = roleIds.split(","); | /*String[] roIds = roleIds.split(","); | ||||
| List<MallUserRole> u2rs = new ArrayList<>(roIds.length); | List<MallUserRole> u2rs = new ArrayList<>(roIds.length); | ||||
| for (String roleId : roIds) { | for (String roleId : roIds) { | ||||
| @@ -169,40 +168,40 @@ public class MallUserInfoController extends BaseController { | |||||
| } | } | ||||
| return true; | return true; | ||||
| } | } | ||||
| @GetMapping("hasButtonPermission") | @GetMapping("hasButtonPermission") | ||||
| public ResultData hasButtonPermission(String permissions){ | |||||
| Map<String,Boolean> map=new HashMap<>(); | |||||
| for(String name:permissions.split(",")){ | |||||
| Long userId = (Long) | |||||
| SecurityUtils.getSubject().getSession().getAttribute(UserSession.userId); | |||||
| boolean has =userInfoService.hasButtonPermission(userId, name); | |||||
| map.put(name, has); | |||||
| } | |||||
| public ResultData hasButtonPermission(String permissions) { | |||||
| Map<String, Boolean> map = new HashMap<>(); | |||||
| for (String name : permissions.split(",")) { | |||||
| Long userId = (Long) | |||||
| SecurityUtils.getSubject().getSession().getAttribute(UserSession.userId); | |||||
| boolean has = userInfoService.hasButtonPermission(userId, name); | |||||
| map.put(name, has); | |||||
| } | |||||
| // StringBuffer buffer = new StringBuffer(); | // StringBuffer buffer = new StringBuffer(); | ||||
| // for(Entry<String, Boolean> entrySet :map.entrySet()){ | // for(Entry<String, Boolean> entrySet :map.entrySet()){ | ||||
| // buffer.append("var "+entrySet.getKey()); | // buffer.append("var "+entrySet.getKey()); | ||||
| // buffer.append("="+entrySet.getValue()); | // buffer.append("="+entrySet.getValue()); | ||||
| // buffer.append(";"); | // buffer.append(";"); | ||||
| // } | // } | ||||
| //return new ResultData(buffer.toString()); | |||||
| return new ResultData(map); | |||||
| //return new ResultData(buffer.toString()); | |||||
| return new ResultData(map); | |||||
| } | } | ||||
| @GetMapping("getUser") | @GetMapping("getUser") | ||||
| public ResultData getUserInfo(){ | |||||
| MallUserInfo info =(MallUserInfo) SecurityUtils.getSubject().getSession().getAttribute(UserSession.userInfo); | |||||
| info.setPassword("保密"); | |||||
| if (info.getIsAdmin() == 1) { // isAdmin | |||||
| MallPermission q = new MallPermission(); | |||||
| PageInfo<MallPermission> list = mallPermissionService.listAsPage(q,1,100); | |||||
| public ResultData getUserInfo() { | |||||
| MallUserInfo info = (MallUserInfo) SecurityUtils.getSubject().getSession().getAttribute(UserSession.userInfo); | |||||
| info.setPassword("保密"); | |||||
| if (info.getIsAdmin() == 1) { // isAdmin | |||||
| MallPermission q = new MallPermission(); | |||||
| PageInfo<MallPermission> list = mallPermissionService.listAsPage(q, 1, 100); | |||||
| String menus = ""; | String menus = ""; | ||||
| for(MallPermission rp :list.getList()) { | |||||
| menus+=rp.getId()+","; | |||||
| for (MallPermission rp : list.getList()) { | |||||
| menus += rp.getId() + ","; | |||||
| } | } | ||||
| if(menus.length()>0) { | |||||
| menus = menus.substring(0, menus.length()-1); | |||||
| if (menus.length() > 0) { | |||||
| menus = menus.substring(0, menus.length() - 1); | |||||
| } | } | ||||
| info.setMenus(menus); | info.setMenus(menus); | ||||
| } else { | } else { | ||||
| @@ -210,22 +209,22 @@ public class MallUserInfoController extends BaseController { | |||||
| MallUserRole ur = new MallUserRole(); | MallUserRole ur = new MallUserRole(); | ||||
| ur.setUid(info.getId()); | ur.setUid(info.getId()); | ||||
| PageInfo<MallUserRole> page = mallUserRoleService.listAsPage(ur, 1, 1); | PageInfo<MallUserRole> page = mallUserRoleService.listAsPage(ur, 1, 1); | ||||
| if(page.getSize()>0) { | |||||
| if (page.getSize() > 0) { | |||||
| Long roleId = page.getList().get(0).getRoleId(); | Long roleId = page.getList().get(0).getRoleId(); | ||||
| MallRolePermission p = new MallRolePermission(); | MallRolePermission p = new MallRolePermission(); | ||||
| p.setRoleId(roleId); | p.setRoleId(roleId); | ||||
| p.setTenantId(info.getTenantId()); | p.setTenantId(info.getTenantId()); | ||||
| PageInfo<MallRolePermission> listAsPage = mallRolePermissionService.listAsPage(p, 1, 100); | PageInfo<MallRolePermission> listAsPage = mallRolePermissionService.listAsPage(p, 1, 100); | ||||
| String menus = ""; | String menus = ""; | ||||
| for(MallRolePermission rp :listAsPage.getList()) { | |||||
| menus+=rp.getPermissionId()+","; | |||||
| for (MallRolePermission rp : listAsPage.getList()) { | |||||
| menus += rp.getPermissionId() + ","; | |||||
| } | } | ||||
| if(menus.length()>0) { | |||||
| menus = menus.substring(0, menus.length()-1); | |||||
| if (menus.length() > 0) { | |||||
| menus = menus.substring(0, menus.length() - 1); | |||||
| } | } | ||||
| info.setMenus(menus); | info.setMenus(menus); | ||||
| } | } | ||||
| } | } | ||||
| return new ResultData(info); | |||||
| return new ResultData(info); | |||||
| } | } | ||||
| } | } | ||||
| @@ -1,12 +1,12 @@ | |||||
| package com.simple.controller; | package com.simple.controller; | ||||
| import com.simple.common.Result; | |||||
| import com.simple.common.ResultData; | import com.simple.common.ResultData; | ||||
| import com.simple.domain.dto.MarkingCouponDataReportDto; | import com.simple.domain.dto.MarkingCouponDataReportDto; | ||||
| import com.simple.service.MarkingDataReportService; | import com.simple.service.MarkingDataReportService; | ||||
| import io.swagger.annotations.Api; | import io.swagger.annotations.Api; | ||||
| import io.swagger.annotations.ApiImplicitParam; | |||||
| import io.swagger.annotations.ApiOperation; | import io.swagger.annotations.ApiOperation; | ||||
| import org.slf4j.Logger; | |||||
| import org.slf4j.LoggerFactory; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.web.bind.annotation.GetMapping; | import org.springframework.web.bind.annotation.GetMapping; | ||||
| import org.springframework.web.bind.annotation.ModelAttribute; | import org.springframework.web.bind.annotation.ModelAttribute; | ||||
| @@ -18,11 +18,13 @@ import org.springframework.web.bind.annotation.RestController; | |||||
| */ | */ | ||||
| @RestController | @RestController | ||||
| @RequestMapping("markingDataReport") | @RequestMapping("markingDataReport") | ||||
| @Api(description="营销报表接口") | |||||
| @Api(description = "营销报表接口") | |||||
| public class MarkingDataReportController extends BaseController { | public class MarkingDataReportController extends BaseController { | ||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||||
| @Autowired | @Autowired | ||||
| private MarkingDataReportService markingDataReportService; | private MarkingDataReportService markingDataReportService; | ||||
| @ApiOperation("查询券数据") | @ApiOperation("查询券数据") | ||||
| @GetMapping("/couponData") | @GetMapping("/couponData") | ||||
| public ResultData findCouponData() { | public ResultData findCouponData() { | ||||
| @@ -31,8 +33,8 @@ public class MarkingDataReportController extends BaseController { | |||||
| @ApiOperation("查询券数据列表") | @ApiOperation("查询券数据列表") | ||||
| @GetMapping("/couponDataList") | @GetMapping("/couponDataList") | ||||
| public ResultData findCouponDataList(@ModelAttribute MarkingCouponDataReportDto markingCouponDataReportDto,Integer pageNum, Integer pageSize) { | |||||
| return new ResultData(markingDataReportService.getCouponDateList(getTenantId(),markingCouponDataReportDto,pageNum,pageSize)); | |||||
| public ResultData findCouponDataList(@ModelAttribute MarkingCouponDataReportDto markingCouponDataReportDto, Integer pageNum, Integer pageSize) { | |||||
| return new ResultData(markingDataReportService.getCouponDateList(getTenantId(), markingCouponDataReportDto, pageNum, pageSize)); | |||||
| } | } | ||||
| @ApiOperation("查询场景投放券数据") | @ApiOperation("查询场景投放券数据") | ||||
| @@ -43,8 +45,8 @@ public class MarkingDataReportController extends BaseController { | |||||
| @ApiOperation("查询场景营销数据列表") | @ApiOperation("查询场景营销数据列表") | ||||
| @GetMapping("/sceneDataList") | @GetMapping("/sceneDataList") | ||||
| public ResultData findSceneDataList(@ModelAttribute MarkingCouponDataReportDto markingCouponDataReportDto,Integer pageNum, Integer pageSize) { | |||||
| return new ResultData(markingDataReportService.getSceneDataList(getTenantId(),markingCouponDataReportDto,pageNum,pageSize)); | |||||
| public ResultData findSceneDataList(@ModelAttribute MarkingCouponDataReportDto markingCouponDataReportDto, Integer pageNum, Integer pageSize) { | |||||
| return new ResultData(markingDataReportService.getSceneDataList(getTenantId(), markingCouponDataReportDto, pageNum, pageSize)); | |||||
| } | } | ||||
| @ApiOperation("查询触达用户数数据") | @ApiOperation("查询触达用户数数据") | ||||
| @@ -55,10 +57,9 @@ public class MarkingDataReportController extends BaseController { | |||||
| @ApiOperation("查询触达用户数数据列表") | @ApiOperation("查询触达用户数数据列表") | ||||
| @GetMapping("/touchUsersDataList") | @GetMapping("/touchUsersDataList") | ||||
| public ResultData touchUsersDataList(@ModelAttribute MarkingCouponDataReportDto markingCouponDataReportDto,Integer pageNum, Integer pageSize) { | |||||
| return new ResultData(markingDataReportService.getTouchUsersReportList(getTenantId(),markingCouponDataReportDto,pageNum,pageSize)); | |||||
| public ResultData touchUsersDataList(@ModelAttribute MarkingCouponDataReportDto markingCouponDataReportDto, Integer pageNum, Integer pageSize) { | |||||
| return new ResultData(markingDataReportService.getTouchUsersReportList(getTenantId(), markingCouponDataReportDto, pageNum, pageSize)); | |||||
| } | } | ||||
| } | } | ||||
| @@ -1,69 +1,59 @@ | |||||
| package com.simple.controller; | package com.simple.controller; | ||||
| import org.apache.log4j.Logger; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.web.bind.annotation.GetMapping; | |||||
| import org.springframework.web.bind.annotation.ModelAttribute; | |||||
| 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 com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| import com.simple.common.Result; | import com.simple.common.Result; | ||||
| import com.simple.common.ResultData; | import com.simple.common.ResultData; | ||||
| import com.simple.domain.po.PushLimit; | import com.simple.domain.po.PushLimit; | ||||
| import com.simple.service.PushLimitService; | import com.simple.service.PushLimitService; | ||||
| import io.swagger.annotations.Api; | import io.swagger.annotations.Api; | ||||
| import io.swagger.annotations.ApiImplicitParam; | import io.swagger.annotations.ApiImplicitParam; | ||||
| import io.swagger.annotations.ApiImplicitParams; | |||||
| import io.swagger.annotations.ApiOperation; | import io.swagger.annotations.ApiOperation; | ||||
| import org.slf4j.Logger; | |||||
| import org.slf4j.LoggerFactory; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.web.bind.annotation.*; | |||||
| @RestController | @RestController | ||||
| @RequestMapping("pushLimit") | @RequestMapping("pushLimit") | ||||
| @Api(description="疲劳度相关接口") | |||||
| public class PushLimitController extends BaseController | |||||
| { | |||||
| @Autowired | |||||
| @Api(description = "疲劳度相关接口") | |||||
| public class PushLimitController extends BaseController { | |||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||||
| @Autowired | |||||
| private PushLimitService pushLimitService; | private PushLimitService pushLimitService; | ||||
| private Logger logger = Logger.getLogger(PushLimitController.class); | |||||
| @ApiOperation("分页列表接口") | |||||
| @ApiOperation("分页列表接口") | |||||
| @GetMapping("list") | @GetMapping("list") | ||||
| public ResultData list(@ModelAttribute PushLimit pushLimit) { | public ResultData list(@ModelAttribute PushLimit pushLimit) { | ||||
| if (null == pushLimit) pushLimit = new PushLimit(); | |||||
| pushLimit.setTenantId(getTenantId()); | |||||
| if (null == pushLimit) pushLimit = new PushLimit(); | |||||
| pushLimit.setTenantId(getTenantId()); | |||||
| final PageInfo<PushLimit> page = pushLimitService.listAsPage(pushLimit, 1, 10); | final PageInfo<PushLimit> page = pushLimitService.listAsPage(pushLimit, 1, 10); | ||||
| return new ResultData(page); | return new ResultData(page); | ||||
| } | } | ||||
| @ApiOperation("根据id更新接口") | @ApiOperation("根据id更新接口") | ||||
| @PostMapping("update") | @PostMapping("update") | ||||
| public ResultData update(@RequestBody PushLimit pushLimit) { | public ResultData update(@RequestBody PushLimit pushLimit) { | ||||
| pushLimit.setMsgAmount(null); | |||||
| pushLimit.setMsgAmount(null); | |||||
| pushLimitService.saveOrUpdate(pushLimit); | pushLimitService.saveOrUpdate(pushLimit); | ||||
| return new ResultData(); | return new ResultData(); | ||||
| } | } | ||||
| @ApiOperation("根据id删除接口") | @ApiOperation("根据id删除接口") | ||||
| @GetMapping("/del") | @GetMapping("/del") | ||||
| @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | |||||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | |||||
| public ResultData delete(Long id) { | public ResultData delete(Long id) { | ||||
| pushLimitService.deleteById(id); | pushLimitService.deleteById(id); | ||||
| return new ResultData(Result.SUCCESS, "删除成功", null); | return new ResultData(Result.SUCCESS, "删除成功", null); | ||||
| } | } | ||||
| @ApiOperation("根据id查询接口") | |||||
| @GetMapping("/findById") | |||||
| @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | |||||
| @ApiOperation("根据id查询接口") | |||||
| @GetMapping("/findById") | |||||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | |||||
| public ResultData findById(Long id) { | public ResultData findById(Long id) { | ||||
| return new ResultData(Result.SUCCESS,"查询成功",pushLimitService.getById(id)); | |||||
| return new ResultData(Result.SUCCESS, "查询成功", pushLimitService.getById(id)); | |||||
| } | } | ||||
| } | } | ||||
| @@ -1,15 +1,9 @@ | |||||
| package com.simple.controller; | package com.simple.controller; | ||||
| import java.io.BufferedInputStream; | |||||
| import java.io.File; | |||||
| import java.io.FileInputStream; | |||||
| import java.io.FileOutputStream; | |||||
| import java.io.IOException; | |||||
| import java.util.HashMap; | |||||
| import java.util.Map; | |||||
| import java.util.UUID; | |||||
| import com.simple.common.ResultData; | |||||
| import io.swagger.annotations.Api; | |||||
| import io.swagger.annotations.ApiOperation; | |||||
| import org.slf4j.Logger; | import org.slf4j.Logger; | ||||
| import org.slf4j.LoggerFactory; | import org.slf4j.LoggerFactory; | ||||
| import org.springframework.beans.factory.annotation.Value; | import org.springframework.beans.factory.annotation.Value; | ||||
| @@ -19,84 +13,86 @@ import org.springframework.web.bind.annotation.RequestParam; | |||||
| import org.springframework.web.bind.annotation.RestController; | import org.springframework.web.bind.annotation.RestController; | ||||
| import org.springframework.web.multipart.MultipartFile; | import org.springframework.web.multipart.MultipartFile; | ||||
| import com.simple.common.ResultData; | |||||
| import io.swagger.annotations.Api; | |||||
| import io.swagger.annotations.ApiOperation; | |||||
| import java.io.BufferedInputStream; | |||||
| import java.io.File; | |||||
| import java.io.FileOutputStream; | |||||
| import java.io.IOException; | |||||
| import java.util.HashMap; | |||||
| import java.util.Map; | |||||
| import java.util.UUID; | |||||
| @RestController | @RestController | ||||
| @RequestMapping(value = "upload") | @RequestMapping(value = "upload") | ||||
| @Api(description="文件上传接口") | |||||
| @Api(description = "文件上传接口") | |||||
| public class UploadController { | public class UploadController { | ||||
| private final Logger logger = LoggerFactory.getLogger(UploadController.class); | |||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||||
| @Value("${fileUpload.path}") | @Value("${fileUpload.path}") | ||||
| private String filePath; | private String filePath; | ||||
| @Value("${fileUpload.server}") | @Value("${fileUpload.server}") | ||||
| private String server; | private String server; | ||||
| /** | /** | ||||
| * 上传文件 | * 上传文件 | ||||
| * | * | ||||
| * @param request | |||||
| * @param multiReq | |||||
| * @return | * @return | ||||
| * @throws Exception | * @throws Exception | ||||
| */ | */ | ||||
| @PostMapping(value = "/fileUpload", consumes="multipart/*" | |||||
| ,headers="content-type=multipart/form-data" ) | |||||
| @PostMapping(value = "/fileUpload", consumes = "multipart/*" | |||||
| , headers = "content-type=multipart/form-data") | |||||
| @ApiOperation("上传文件") | @ApiOperation("上传文件") | ||||
| public ResultData fileUpload(@RequestParam("file") MultipartFile multiReq | |||||
| ) { | |||||
| ResultData data = new ResultData(); | |||||
| FileOutputStream fos=null; | |||||
| BufferedInputStream fs=null; | |||||
| try { | |||||
| File targetFile = new File(filePath); | |||||
| if(!targetFile.exists()){ | |||||
| targetFile.mkdirs(); | |||||
| } | |||||
| String fileName = UUID.randomUUID().toString(); | |||||
| int dot = multiReq.getOriginalFilename().lastIndexOf('.'); | |||||
| fileName=fileName+ multiReq.getOriginalFilename().substring(dot, multiReq.getOriginalFilename().length()); | |||||
| fos = new FileOutputStream(new File(filePath+File.separator+fileName)); | |||||
| fs=(BufferedInputStream) multiReq.getInputStream(); | |||||
| byte[] buffer=new byte[1024]; | |||||
| int len=0; | |||||
| while((len=fs.read(buffer))!=-1){ | |||||
| fos.write(buffer, 0, len); | |||||
| } | |||||
| fos.close(); | |||||
| fs.close(); | |||||
| data.code=ResultData.SUCCESS; | |||||
| Map<String,String> map = new HashMap<>(); | |||||
| map.put("imgarray", server+"/"+fileName); | |||||
| data.data=map; | |||||
| } catch (Exception e) { | |||||
| e.printStackTrace(); | |||||
| data.code=ResultData.ERROR; | |||||
| data.message="上传失败"; | |||||
| }finally { | |||||
| if(fos!=null) { | |||||
| try { | |||||
| fos.close(); | |||||
| } catch (IOException e) { | |||||
| e.printStackTrace(); | |||||
| } | |||||
| } | |||||
| if(fs!=null) { | |||||
| try { | |||||
| fs.close(); | |||||
| }catch(IOException e) { | |||||
| e.printStackTrace(); | |||||
| } | |||||
| } | |||||
| } | |||||
| public ResultData fileUpload(@RequestParam("file") MultipartFile multiReq) { | |||||
| ResultData data = new ResultData(); | |||||
| FileOutputStream fos = null; | |||||
| BufferedInputStream fs = null; | |||||
| try { | |||||
| File targetFile = new File(filePath); | |||||
| if (!targetFile.exists()) { | |||||
| targetFile.mkdirs(); | |||||
| } | |||||
| String fileName = UUID.randomUUID().toString(); | |||||
| int dot = multiReq.getOriginalFilename().lastIndexOf('.'); | |||||
| fileName = fileName + multiReq.getOriginalFilename().substring(dot, multiReq.getOriginalFilename().length()); | |||||
| fos = new FileOutputStream(new File(filePath + File.separator + fileName)); | |||||
| fs = (BufferedInputStream) multiReq.getInputStream(); | |||||
| byte[] buffer = new byte[1024]; | |||||
| int len = 0; | |||||
| while ((len = fs.read(buffer)) != -1) { | |||||
| fos.write(buffer, 0, len); | |||||
| } | |||||
| fos.close(); | |||||
| fs.close(); | |||||
| data.code = ResultData.SUCCESS; | |||||
| Map<String, String> map = new HashMap<>(); | |||||
| map.put("imgarray", server + "/" + fileName); | |||||
| data.data = map; | |||||
| } catch (Exception e) { | |||||
| e.printStackTrace(); | |||||
| data.code = ResultData.ERROR; | |||||
| data.message = "上传失败"; | |||||
| } finally { | |||||
| if (fos != null) { | |||||
| try { | |||||
| fos.close(); | |||||
| } catch (IOException e) { | |||||
| e.printStackTrace(); | |||||
| } | |||||
| } | |||||
| if (fs != null) { | |||||
| try { | |||||
| fs.close(); | |||||
| } catch (IOException e) { | |||||
| e.printStackTrace(); | |||||
| } | |||||
| } | |||||
| } | |||||
| return data; | return data; | ||||
| } | } | ||||
| } | } | ||||
| @@ -1,42 +1,38 @@ | |||||
| package com.simple.controller; | package com.simple.controller; | ||||
| import com.simple.domain.po.MallUserInfo; | |||||
| import org.apache.log4j.Logger; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.util.Assert; | |||||
| import org.springframework.web.bind.annotation.*; | |||||
| import com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| import com.simple.common.Result; | import com.simple.common.Result; | ||||
| import com.simple.common.ResultData; | import com.simple.common.ResultData; | ||||
| import com.simple.domain.po.WxAdminLog; | import com.simple.domain.po.WxAdminLog; | ||||
| import com.simple.service.WxAdminLogService; | import com.simple.service.WxAdminLogService; | ||||
| import io.swagger.annotations.ApiImplicitParam; | import io.swagger.annotations.ApiImplicitParam; | ||||
| import io.swagger.annotations.ApiImplicitParams; | import io.swagger.annotations.ApiImplicitParams; | ||||
| import io.swagger.annotations.ApiOperation; | import io.swagger.annotations.ApiOperation; | ||||
| import org.slf4j.Logger; | |||||
| import org.slf4j.LoggerFactory; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.web.bind.annotation.*; | |||||
| @RestController | @RestController | ||||
| @RequestMapping("wxAdminLog") | @RequestMapping("wxAdminLog") | ||||
| public class WxAdminLogController extends BaseController | |||||
| { | |||||
| @Autowired | |||||
| public class WxAdminLogController extends BaseController { | |||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||||
| @Autowired | |||||
| private WxAdminLogService wxAdminLogService; | private WxAdminLogService wxAdminLogService; | ||||
| private Logger logger = Logger.getLogger(WxAdminLogController.class); | |||||
| @ApiOperation("分页列表接口") | |||||
| @ApiOperation("分页列表接口") | |||||
| @GetMapping("list") | @GetMapping("list") | ||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name="pageNum",value="页数",dataType="int", paramType = "query",required=true), | |||||
| @ApiImplicitParam(name="pageSize",value="每页条数",dataType="int", paramType = "query",required=true)}) | |||||
| public ResultData list(@ModelAttribute WxAdminLog wxAdminLog,Integer pageNum, Integer pageSize) { | |||||
| if (null == wxAdminLog) wxAdminLog = new WxAdminLog(); | |||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | |||||
| public ResultData list(@ModelAttribute WxAdminLog wxAdminLog, Integer pageNum, Integer pageSize) { | |||||
| if (null == wxAdminLog) wxAdminLog = new WxAdminLog(); | |||||
| final PageInfo<WxAdminLog> page = wxAdminLogService.listAsPage(wxAdminLog, pageNum, pageSize); | final PageInfo<WxAdminLog> page = wxAdminLogService.listAsPage(wxAdminLog, pageNum, pageSize); | ||||
| return new ResultData(page); | return new ResultData(page); | ||||
| } | } | ||||
| @ApiOperation("新增接口") | |||||
| @ApiOperation("新增接口") | |||||
| @PostMapping("add") | @PostMapping("add") | ||||
| public ResultData add(@RequestBody WxAdminLog wxAdminLog) { | public ResultData add(@RequestBody WxAdminLog wxAdminLog) { | ||||
| //Assert.notNull(wxAdminLog.getName(), "角色名不能为空"); | //Assert.notNull(wxAdminLog.getName(), "角色名不能为空"); | ||||
| @@ -48,25 +44,25 @@ public class WxAdminLogController extends BaseController | |||||
| @ApiOperation("根据id更新接口") | @ApiOperation("根据id更新接口") | ||||
| @PostMapping("update") | @PostMapping("update") | ||||
| public ResultData update(@RequestBody WxAdminLog wxAdminLog) { | public ResultData update(@RequestBody WxAdminLog wxAdminLog) { | ||||
| String tenantId = getTenantId(); | |||||
| wxAdminLog.setTenantId(tenantId); | |||||
| String tenantId = getTenantId(); | |||||
| wxAdminLog.setTenantId(tenantId); | |||||
| wxAdminLogService.saveOrUpdate(wxAdminLog); | wxAdminLogService.saveOrUpdate(wxAdminLog); | ||||
| return new ResultData(); | return new ResultData(); | ||||
| } | } | ||||
| @ApiOperation("根据id删除接口") | @ApiOperation("根据id删除接口") | ||||
| @GetMapping("/del") | @GetMapping("/del") | ||||
| @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | |||||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | |||||
| public ResultData delete(Long id) { | public ResultData delete(Long id) { | ||||
| wxAdminLogService.deleteById(id); | wxAdminLogService.deleteById(id); | ||||
| return new ResultData(Result.SUCCESS, "删除成功", null); | return new ResultData(Result.SUCCESS, "删除成功", null); | ||||
| } | } | ||||
| @ApiOperation("根据id查询接口") | |||||
| @GetMapping("/findById") | |||||
| @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | |||||
| @ApiOperation("根据id查询接口") | |||||
| @GetMapping("/findById") | |||||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | |||||
| public ResultData findById(Long id) { | public ResultData findById(Long id) { | ||||
| return new ResultData(Result.SUCCESS,"查询成功",wxAdminLogService.getById(id)); | |||||
| return new ResultData(Result.SUCCESS, "查询成功", wxAdminLogService.getById(id)); | |||||
| } | } | ||||
| @ApiOperation("PV计数") | @ApiOperation("PV计数") | ||||
| @@ -77,5 +73,5 @@ public class WxAdminLogController extends BaseController | |||||
| wxAdminLogService.saveLogCount(wxAdminLog); | wxAdminLogService.saveLogCount(wxAdminLog); | ||||
| return new ResultData(); | return new ResultData(); | ||||
| } | } | ||||
| } | } | ||||
| @@ -1,41 +1,38 @@ | |||||
| package com.simple.controller; | package com.simple.controller; | ||||
| import org.apache.log4j.Logger; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.util.Assert; | |||||
| import org.springframework.web.bind.annotation.*; | |||||
| import com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| import com.simple.common.Result; | import com.simple.common.Result; | ||||
| import com.simple.common.ResultData; | import com.simple.common.ResultData; | ||||
| import com.simple.domain.po.WxAppinfo; | import com.simple.domain.po.WxAppinfo; | ||||
| import com.simple.service.WxAppinfoService; | import com.simple.service.WxAppinfoService; | ||||
| import io.swagger.annotations.ApiImplicitParam; | import io.swagger.annotations.ApiImplicitParam; | ||||
| import io.swagger.annotations.ApiImplicitParams; | import io.swagger.annotations.ApiImplicitParams; | ||||
| import io.swagger.annotations.ApiOperation; | import io.swagger.annotations.ApiOperation; | ||||
| import org.slf4j.Logger; | |||||
| import org.slf4j.LoggerFactory; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.web.bind.annotation.*; | |||||
| @RestController | @RestController | ||||
| @RequestMapping("wxAppinfo") | @RequestMapping("wxAppinfo") | ||||
| public class WxAppinfoController extends BaseController | |||||
| { | |||||
| @Autowired | |||||
| public class WxAppinfoController extends BaseController { | |||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||||
| @Autowired | |||||
| private WxAppinfoService wxAppinfoService; | private WxAppinfoService wxAppinfoService; | ||||
| private Logger logger = Logger.getLogger(WxAppinfoController.class); | |||||
| @ApiOperation("分页列表接口") | |||||
| @ApiOperation("分页列表接口") | |||||
| @GetMapping("list") | @GetMapping("list") | ||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name="pageNum",value="页数",dataType="int", paramType = "query",required=true), | |||||
| @ApiImplicitParam(name="pageSize",value="每页条数",dataType="int", paramType = "query",required=true)}) | |||||
| public ResultData list(@ModelAttribute WxAppinfo wxAppinfo,Integer pageNum, Integer pageSize) { | |||||
| if (null == wxAppinfo) wxAppinfo = new WxAppinfo(); | |||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | |||||
| public ResultData list(@ModelAttribute WxAppinfo wxAppinfo, Integer pageNum, Integer pageSize) { | |||||
| if (null == wxAppinfo) wxAppinfo = new WxAppinfo(); | |||||
| final PageInfo<WxAppinfo> page = wxAppinfoService.listAsPage(wxAppinfo, pageNum, pageSize); | final PageInfo<WxAppinfo> page = wxAppinfoService.listAsPage(wxAppinfo, pageNum, pageSize); | ||||
| return new ResultData(page); | return new ResultData(page); | ||||
| } | } | ||||
| @ApiOperation("新增接口") | |||||
| @ApiOperation("新增接口") | |||||
| @PostMapping("add") | @PostMapping("add") | ||||
| public ResultData add(@RequestBody WxAppinfo wxAppinfo) { | public ResultData add(@RequestBody WxAppinfo wxAppinfo) { | ||||
| //Assert.notNull(wxAppinfo.getName(), "角色名不能为空"); | //Assert.notNull(wxAppinfo.getName(), "角色名不能为空"); | ||||
| @@ -53,19 +50,18 @@ public class WxAppinfoController extends BaseController | |||||
| @ApiOperation("根据id删除接口") | @ApiOperation("根据id删除接口") | ||||
| @GetMapping("/del") | @GetMapping("/del") | ||||
| @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | |||||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | |||||
| public ResultData delete(Long id) { | public ResultData delete(Long id) { | ||||
| wxAppinfoService.deleteById(id); | wxAppinfoService.deleteById(id); | ||||
| return new ResultData(Result.SUCCESS, "删除成功", null); | return new ResultData(Result.SUCCESS, "删除成功", null); | ||||
| } | } | ||||
| @ApiOperation("根据id查询接口") | |||||
| @GetMapping("/findById") | |||||
| @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | |||||
| @ApiOperation("根据id查询接口") | |||||
| @GetMapping("/findById") | |||||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | |||||
| public ResultData findById(Long id) { | public ResultData findById(Long id) { | ||||
| return new ResultData(Result.SUCCESS,"查询成功",wxAppinfoService.getById(id)); | |||||
| return new ResultData(Result.SUCCESS, "查询成功", wxAppinfoService.getById(id)); | |||||
| } | } | ||||
| } | } | ||||
| @@ -1,41 +1,38 @@ | |||||
| package com.simple.controller; | package com.simple.controller; | ||||
| import org.apache.log4j.Logger; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.util.Assert; | |||||
| import org.springframework.web.bind.annotation.*; | |||||
| import com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| import com.simple.common.Result; | import com.simple.common.Result; | ||||
| import com.simple.common.ResultData; | import com.simple.common.ResultData; | ||||
| import com.simple.domain.po.WxBLog; | import com.simple.domain.po.WxBLog; | ||||
| import com.simple.service.WxBLogService; | import com.simple.service.WxBLogService; | ||||
| import io.swagger.annotations.ApiImplicitParam; | import io.swagger.annotations.ApiImplicitParam; | ||||
| import io.swagger.annotations.ApiImplicitParams; | import io.swagger.annotations.ApiImplicitParams; | ||||
| import io.swagger.annotations.ApiOperation; | import io.swagger.annotations.ApiOperation; | ||||
| import org.slf4j.Logger; | |||||
| import org.slf4j.LoggerFactory; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.web.bind.annotation.*; | |||||
| @RestController | @RestController | ||||
| @RequestMapping("wxBLog") | @RequestMapping("wxBLog") | ||||
| public class WxBLogController extends BaseController | |||||
| { | |||||
| @Autowired | |||||
| public class WxBLogController extends BaseController { | |||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||||
| @Autowired | |||||
| private WxBLogService wxBLogService; | private WxBLogService wxBLogService; | ||||
| private Logger logger = Logger.getLogger(WxBLogController.class); | |||||
| @ApiOperation("分页列表接口") | |||||
| @ApiOperation("分页列表接口") | |||||
| @GetMapping("list") | @GetMapping("list") | ||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name="pageNum",value="页数",dataType="int", paramType = "query",required=true), | |||||
| @ApiImplicitParam(name="pageSize",value="每页条数",dataType="int", paramType = "query",required=true)}) | |||||
| public ResultData list(@ModelAttribute WxBLog wxBLog,Integer pageNum, Integer pageSize) { | |||||
| if (null == wxBLog) wxBLog = new WxBLog(); | |||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | |||||
| public ResultData list(@ModelAttribute WxBLog wxBLog, Integer pageNum, Integer pageSize) { | |||||
| if (null == wxBLog) wxBLog = new WxBLog(); | |||||
| final PageInfo<WxBLog> page = wxBLogService.listAsPage(wxBLog, pageNum, pageSize); | final PageInfo<WxBLog> page = wxBLogService.listAsPage(wxBLog, pageNum, pageSize); | ||||
| return new ResultData(page); | return new ResultData(page); | ||||
| } | } | ||||
| @ApiOperation("新增接口") | |||||
| @ApiOperation("新增接口") | |||||
| @PostMapping("add") | @PostMapping("add") | ||||
| public ResultData add(@RequestBody WxBLog wxBLog) { | public ResultData add(@RequestBody WxBLog wxBLog) { | ||||
| //Assert.notNull(wxBLog.getName(), "角色名不能为空"); | //Assert.notNull(wxBLog.getName(), "角色名不能为空"); | ||||
| @@ -53,19 +50,18 @@ public class WxBLogController extends BaseController | |||||
| @ApiOperation("根据id删除接口") | @ApiOperation("根据id删除接口") | ||||
| @GetMapping("/del") | @GetMapping("/del") | ||||
| @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | |||||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | |||||
| public ResultData delete(Long id) { | public ResultData delete(Long id) { | ||||
| wxBLogService.deleteById(id); | wxBLogService.deleteById(id); | ||||
| return new ResultData(Result.SUCCESS, "删除成功", null); | return new ResultData(Result.SUCCESS, "删除成功", null); | ||||
| } | } | ||||
| @ApiOperation("根据id查询接口") | |||||
| @GetMapping("/findById") | |||||
| @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | |||||
| @ApiOperation("根据id查询接口") | |||||
| @GetMapping("/findById") | |||||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | |||||
| public ResultData findById(Long id) { | public ResultData findById(Long id) { | ||||
| return new ResultData(Result.SUCCESS,"查询成功",wxBLogService.getById(id)); | |||||
| return new ResultData(Result.SUCCESS, "查询成功", wxBLogService.getById(id)); | |||||
| } | } | ||||
| } | } | ||||
| @@ -7,7 +7,8 @@ import com.simple.domain.po.WxBillRent; | |||||
| import com.simple.service.WxBillRentService; | import com.simple.service.WxBillRentService; | ||||
| import io.swagger.annotations.ApiImplicitParam; | import io.swagger.annotations.ApiImplicitParam; | ||||
| import io.swagger.annotations.ApiImplicitParams; | import io.swagger.annotations.ApiImplicitParams; | ||||
| import org.apache.log4j.Logger; | |||||
| import org.slf4j.Logger; | |||||
| import org.slf4j.LoggerFactory; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.web.bind.annotation.*; | import org.springframework.web.bind.annotation.*; | ||||
| @@ -15,21 +16,20 @@ import java.util.Map; | |||||
| @RestController | @RestController | ||||
| @RequestMapping("wxBillRent") | @RequestMapping("wxBillRent") | ||||
| public class WxBillRentController extends BaseController | |||||
| { | |||||
| @Autowired | |||||
| private WxBillRentService wxBillRentService; | |||||
| public class WxBillRentController extends BaseController { | |||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||||
| private Logger logger = Logger.getLogger(WxBillRentController.class); | |||||
| @Autowired | |||||
| private WxBillRentService wxBillRentService; | |||||
| @GetMapping("list") | @GetMapping("list") | ||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name="pageNum",value="页数",dataType="int", paramType = "query",required=true), | |||||
| @ApiImplicitParam(name="pageSize",value="每页条数",dataType="int", paramType = "query",required=true)}) | |||||
| public ResultData list(@ModelAttribute WxBillRent wxBillRent,Integer pageNum, Integer pageSize) { | |||||
| if (null == wxBillRent) wxBillRent = new WxBillRent(); | |||||
| wxBillRent.setTenantId(getTenantId()); | |||||
| wxBillRent.setSortColumns(WxBillRent.Field.Id_DESC); | |||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | |||||
| public ResultData list(@ModelAttribute WxBillRent wxBillRent, Integer pageNum, Integer pageSize) { | |||||
| if (null == wxBillRent) wxBillRent = new WxBillRent(); | |||||
| wxBillRent.setTenantId(getTenantId()); | |||||
| wxBillRent.setSortColumns(WxBillRent.Field.Id_DESC); | |||||
| final PageInfo<Map<String, Object>> page = wxBillRentService.listAsPage(wxBillRent, pageNum, pageSize); | final PageInfo<Map<String, Object>> page = wxBillRentService.listAsPage(wxBillRent, pageNum, pageSize); | ||||
| return new ResultData(page); | return new ResultData(page); | ||||
| } | } | ||||
| @@ -40,28 +40,27 @@ public class WxBillRentController extends BaseController | |||||
| //Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名"); | //Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名"); | ||||
| wxBillRent.setTenantId(getTenantId()); | wxBillRent.setTenantId(getTenantId()); | ||||
| wxBillRentService.saveOrUpdate(wxBillRent); | wxBillRentService.saveOrUpdate(wxBillRent); | ||||
| return new ResultData(ResultData.SUCCESS,"操作成功"); | |||||
| return new ResultData(ResultData.SUCCESS, "操作成功"); | |||||
| } | } | ||||
| @PostMapping("update") | @PostMapping("update") | ||||
| public ResultData update(@RequestBody WxBillRent wxBillRent) { | public ResultData update(@RequestBody WxBillRent wxBillRent) { | ||||
| wxBillRentService.saveOrUpdate(wxBillRent); | wxBillRentService.saveOrUpdate(wxBillRent); | ||||
| return new ResultData(ResultData.SUCCESS,"操作成功"); | |||||
| return new ResultData(ResultData.SUCCESS, "操作成功"); | |||||
| } | } | ||||
| @GetMapping("/del") | @GetMapping("/del") | ||||
| @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | |||||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | |||||
| public ResultData delete(Long id) { | public ResultData delete(Long id) { | ||||
| wxBillRentService.deleteById(id); | wxBillRentService.deleteById(id); | ||||
| return new ResultData(Result.SUCCESS, "删除成功", null); | return new ResultData(Result.SUCCESS, "删除成功", null); | ||||
| } | } | ||||
| @GetMapping("/findById") | |||||
| @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | |||||
| @GetMapping("/findById") | |||||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | |||||
| public ResultData findById(Long id) { | public ResultData findById(Long id) { | ||||
| return new ResultData(Result.SUCCESS,"查询成功",wxBillRentService.getById(id)); | |||||
| return new ResultData(Result.SUCCESS, "查询成功", wxBillRentService.getById(id)); | |||||
| } | } | ||||
| } | } | ||||
| @@ -1,41 +1,38 @@ | |||||
| package com.simple.controller; | package com.simple.controller; | ||||
| import org.apache.log4j.Logger; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.util.Assert; | |||||
| import org.springframework.web.bind.annotation.*; | |||||
| import com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| import com.simple.common.Result; | import com.simple.common.Result; | ||||
| import com.simple.common.ResultData; | import com.simple.common.ResultData; | ||||
| import com.simple.domain.po.WxBusiness; | import com.simple.domain.po.WxBusiness; | ||||
| import com.simple.service.WxBusinessService; | import com.simple.service.WxBusinessService; | ||||
| import io.swagger.annotations.ApiImplicitParam; | import io.swagger.annotations.ApiImplicitParam; | ||||
| import io.swagger.annotations.ApiImplicitParams; | import io.swagger.annotations.ApiImplicitParams; | ||||
| import io.swagger.annotations.ApiOperation; | import io.swagger.annotations.ApiOperation; | ||||
| import org.slf4j.Logger; | |||||
| import org.slf4j.LoggerFactory; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.web.bind.annotation.*; | |||||
| @RestController | @RestController | ||||
| @RequestMapping("wxBusiness") | @RequestMapping("wxBusiness") | ||||
| public class WxBusinessController extends BaseController | |||||
| { | |||||
| @Autowired | |||||
| public class WxBusinessController extends BaseController { | |||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||||
| @Autowired | |||||
| private WxBusinessService wxBusinessService; | private WxBusinessService wxBusinessService; | ||||
| private Logger logger = Logger.getLogger(WxBusinessController.class); | |||||
| @ApiOperation("分页列表接口") | |||||
| @ApiOperation("分页列表接口") | |||||
| @GetMapping("list") | @GetMapping("list") | ||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name="pageNum",value="页数",dataType="int", paramType = "query",required=true), | |||||
| @ApiImplicitParam(name="pageSize",value="每页条数",dataType="int", paramType = "query",required=true)}) | |||||
| public ResultData list(@ModelAttribute WxBusiness wxBusiness,Integer pageNum, Integer pageSize) { | |||||
| if (null == wxBusiness) wxBusiness = new WxBusiness(); | |||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | |||||
| public ResultData list(@ModelAttribute WxBusiness wxBusiness, Integer pageNum, Integer pageSize) { | |||||
| if (null == wxBusiness) wxBusiness = new WxBusiness(); | |||||
| final PageInfo<WxBusiness> page = wxBusinessService.listAsPage(wxBusiness, pageNum, pageSize); | final PageInfo<WxBusiness> page = wxBusinessService.listAsPage(wxBusiness, pageNum, pageSize); | ||||
| return new ResultData(page); | return new ResultData(page); | ||||
| } | } | ||||
| @ApiOperation("新增接口") | |||||
| @ApiOperation("新增接口") | |||||
| @PostMapping("add") | @PostMapping("add") | ||||
| public ResultData add(@RequestBody WxBusiness wxBusiness) { | public ResultData add(@RequestBody WxBusiness wxBusiness) { | ||||
| //Assert.notNull(wxBusiness.getName(), "角色名不能为空"); | //Assert.notNull(wxBusiness.getName(), "角色名不能为空"); | ||||
| @@ -53,19 +50,18 @@ public class WxBusinessController extends BaseController | |||||
| @ApiOperation("根据id删除接口") | @ApiOperation("根据id删除接口") | ||||
| @GetMapping("/del") | @GetMapping("/del") | ||||
| @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | |||||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | |||||
| public ResultData delete(Long id) { | public ResultData delete(Long id) { | ||||
| wxBusinessService.deleteById(id); | wxBusinessService.deleteById(id); | ||||
| return new ResultData(Result.SUCCESS, "删除成功", null); | return new ResultData(Result.SUCCESS, "删除成功", null); | ||||
| } | } | ||||
| @ApiOperation("根据id查询接口") | |||||
| @GetMapping("/findById") | |||||
| @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | |||||
| @ApiOperation("根据id查询接口") | |||||
| @GetMapping("/findById") | |||||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | |||||
| public ResultData findById(Long id) { | public ResultData findById(Long id) { | ||||
| return new ResultData(Result.SUCCESS,"查询成功",wxBusinessService.getById(id)); | |||||
| return new ResultData(Result.SUCCESS, "查询成功", wxBusinessService.getById(id)); | |||||
| } | } | ||||
| } | } | ||||
| @@ -1,6 +1,7 @@ | |||||
| package com.simple.controller; | package com.simple.controller; | ||||
| import org.apache.log4j.Logger; | |||||
| import org.slf4j.Logger; | |||||
| import org.slf4j.LoggerFactory; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.util.Assert; | import org.springframework.util.Assert; | ||||
| import org.springframework.web.bind.annotation.*; | import org.springframework.web.bind.annotation.*; | ||||
| @@ -17,12 +18,11 @@ import io.swagger.annotations.ApiOperation; | |||||
| @RestController | @RestController | ||||
| @RequestMapping("wxCLog") | @RequestMapping("wxCLog") | ||||
| public class WxCLogController extends BaseController | |||||
| { | |||||
| public class WxCLogController extends BaseController { | |||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||||
| @Autowired | @Autowired | ||||
| private WxCLogService wxCLogService; | private WxCLogService wxCLogService; | ||||
| private Logger logger = Logger.getLogger(WxCLogController.class); | |||||
| @ApiOperation("分页列表接口") | @ApiOperation("分页列表接口") | ||||
| @GetMapping("list") | @GetMapping("list") | ||||
| @@ -13,7 +13,8 @@ import io.swagger.annotations.ApiImplicitParam; | |||||
| import io.swagger.annotations.ApiImplicitParams; | import io.swagger.annotations.ApiImplicitParams; | ||||
| import io.swagger.annotations.ApiOperation; | import io.swagger.annotations.ApiOperation; | ||||
| import org.apache.commons.lang3.StringUtils; | import org.apache.commons.lang3.StringUtils; | ||||
| import org.apache.log4j.Logger; | |||||
| import org.slf4j.Logger; | |||||
| import org.slf4j.LoggerFactory; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.web.bind.annotation.*; | import org.springframework.web.bind.annotation.*; | ||||
| @@ -25,6 +26,8 @@ import java.util.Map; | |||||
| @RequestMapping("wxCUserBasicInfo") | @RequestMapping("wxCUserBasicInfo") | ||||
| @Api(description = "会员管理相关接口") | @Api(description = "会员管理相关接口") | ||||
| public class WxCUserBasicInfoController extends BaseController { | public class WxCUserBasicInfoController extends BaseController { | ||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||||
| @Autowired | @Autowired | ||||
| private WxCUserBasicInfoService wxCUserBasicInfoService; | private WxCUserBasicInfoService wxCUserBasicInfoService; | ||||
| @@ -43,8 +46,6 @@ public class WxCUserBasicInfoController extends BaseController { | |||||
| @Autowired | @Autowired | ||||
| private WxCouponService wxCouponService; | private WxCouponService wxCouponService; | ||||
| private Logger logger = Logger.getLogger(WxCUserBasicInfoController.class); | |||||
| @ApiOperation("分页列表接口") | @ApiOperation("分页列表接口") | ||||
| @GetMapping("list") | @GetMapping("list") | ||||
| @ApiImplicitParams({ | @ApiImplicitParams({ | ||||
| @@ -54,7 +55,7 @@ public class WxCUserBasicInfoController extends BaseController { | |||||
| if (null == wxCUserBasicInfo) wxCUserBasicInfo = new WxCUserBasicInfoDto(); | if (null == wxCUserBasicInfo) wxCUserBasicInfo = new WxCUserBasicInfoDto(); | ||||
| String tenantId = getTenantId(); | String tenantId = getTenantId(); | ||||
| wxCUserBasicInfo.setTenantId(tenantId); | wxCUserBasicInfo.setTenantId(tenantId); | ||||
| PageInfo<Map<String,Object>> page = wxCUserBasicInfoService.queryListMap(wxCUserBasicInfo, pageNum, pageSize); | |||||
| PageInfo<Map<String, Object>> page = wxCUserBasicInfoService.queryListMap(wxCUserBasicInfo, pageNum, pageSize); | |||||
| // PageInfo<WxCUserBasicInfo> page = wxCUserBasicInfoService.list(wxCUserBasicInfo, pageNum, pageSize); | // PageInfo<WxCUserBasicInfo> page = wxCUserBasicInfoService.list(wxCUserBasicInfo, pageNum, pageSize); | ||||
| // if (page.getSize() == 0 && StringUtils.isNotBlank(wxCUserBasicInfo.getPhone()) | // if (page.getSize() == 0 && StringUtils.isNotBlank(wxCUserBasicInfo.getPhone()) | ||||
| // && wxCUserBasicInfo.getEndTime() == null && wxCUserBasicInfo.getStartTime() == null | // && wxCUserBasicInfo.getEndTime() == null && wxCUserBasicInfo.getStartTime() == null | ||||
| @@ -1,41 +1,38 @@ | |||||
| package com.simple.controller; | package com.simple.controller; | ||||
| import org.apache.log4j.Logger; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.util.Assert; | |||||
| import org.springframework.web.bind.annotation.*; | |||||
| import com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| import com.simple.common.Result; | import com.simple.common.Result; | ||||
| import com.simple.common.ResultData; | import com.simple.common.ResultData; | ||||
| import com.simple.domain.po.WxCUserCar; | import com.simple.domain.po.WxCUserCar; | ||||
| import com.simple.service.WxCUserCarService; | import com.simple.service.WxCUserCarService; | ||||
| import io.swagger.annotations.ApiImplicitParam; | import io.swagger.annotations.ApiImplicitParam; | ||||
| import io.swagger.annotations.ApiImplicitParams; | import io.swagger.annotations.ApiImplicitParams; | ||||
| import io.swagger.annotations.ApiOperation; | import io.swagger.annotations.ApiOperation; | ||||
| import org.slf4j.Logger; | |||||
| import org.slf4j.LoggerFactory; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.web.bind.annotation.*; | |||||
| @RestController | @RestController | ||||
| @RequestMapping("wxCUserCar") | @RequestMapping("wxCUserCar") | ||||
| public class WxCUserCarController extends BaseController | |||||
| { | |||||
| @Autowired | |||||
| public class WxCUserCarController extends BaseController { | |||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||||
| @Autowired | |||||
| private WxCUserCarService wxCUserCarService; | private WxCUserCarService wxCUserCarService; | ||||
| private Logger logger = Logger.getLogger(WxCUserCarController.class); | |||||
| @ApiOperation("分页列表接口") | |||||
| @ApiOperation("分页列表接口") | |||||
| @GetMapping("list") | @GetMapping("list") | ||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name="pageNum",value="页数",dataType="int", paramType = "query",required=true), | |||||
| @ApiImplicitParam(name="pageSize",value="每页条数",dataType="int", paramType = "query",required=true)}) | |||||
| public ResultData list(@ModelAttribute WxCUserCar wxCUserCar,Integer pageNum, Integer pageSize) { | |||||
| if (null == wxCUserCar) wxCUserCar = new WxCUserCar(); | |||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | |||||
| public ResultData list(@ModelAttribute WxCUserCar wxCUserCar, Integer pageNum, Integer pageSize) { | |||||
| if (null == wxCUserCar) wxCUserCar = new WxCUserCar(); | |||||
| final PageInfo<WxCUserCar> page = wxCUserCarService.listAsPage(wxCUserCar, pageNum, pageSize); | final PageInfo<WxCUserCar> page = wxCUserCarService.listAsPage(wxCUserCar, pageNum, pageSize); | ||||
| return new ResultData(page); | return new ResultData(page); | ||||
| } | } | ||||
| @ApiOperation("新增接口") | |||||
| @ApiOperation("新增接口") | |||||
| @PostMapping("add") | @PostMapping("add") | ||||
| public ResultData add(@RequestBody WxCUserCar wxCUserCar) { | public ResultData add(@RequestBody WxCUserCar wxCUserCar) { | ||||
| //Assert.notNull(wxCUserCar.getName(), "角色名不能为空"); | //Assert.notNull(wxCUserCar.getName(), "角色名不能为空"); | ||||
| @@ -53,19 +50,18 @@ public class WxCUserCarController extends BaseController | |||||
| @ApiOperation("根据id删除接口") | @ApiOperation("根据id删除接口") | ||||
| @GetMapping("/del") | @GetMapping("/del") | ||||
| @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | |||||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | |||||
| public ResultData delete(Long id) { | public ResultData delete(Long id) { | ||||
| wxCUserCarService.deleteById(id); | wxCUserCarService.deleteById(id); | ||||
| return new ResultData(Result.SUCCESS, "删除成功", null); | return new ResultData(Result.SUCCESS, "删除成功", null); | ||||
| } | } | ||||
| @ApiOperation("根据id查询接口") | |||||
| @GetMapping("/findById") | |||||
| @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | |||||
| @ApiOperation("根据id查询接口") | |||||
| @GetMapping("/findById") | |||||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | |||||
| public ResultData findById(Long id) { | public ResultData findById(Long id) { | ||||
| return new ResultData(Result.SUCCESS,"查询成功",wxCUserCarService.getById(id)); | |||||
| return new ResultData(Result.SUCCESS, "查询成功", wxCUserCarService.getById(id)); | |||||
| } | } | ||||
| } | } | ||||
| @@ -1,6 +1,7 @@ | |||||
| package com.simple.controller; | package com.simple.controller; | ||||
| import org.apache.log4j.Logger; | |||||
| import org.slf4j.Logger; | |||||
| import org.slf4j.LoggerFactory; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.util.Assert; | import org.springframework.util.Assert; | ||||
| import org.springframework.web.bind.annotation.*; | import org.springframework.web.bind.annotation.*; | ||||
| @@ -17,12 +18,11 @@ import io.swagger.annotations.ApiOperation; | |||||
| @RestController | @RestController | ||||
| @RequestMapping("wxCUser") | @RequestMapping("wxCUser") | ||||
| public class WxCUserController extends BaseController | |||||
| { | |||||
| public class WxCUserController extends BaseController { | |||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||||
| @Autowired | @Autowired | ||||
| private WxCUserService wxCUserService; | private WxCUserService wxCUserService; | ||||
| private Logger logger = Logger.getLogger(WxCUserController.class); | |||||
| @ApiOperation("分页列表接口") | @ApiOperation("分页列表接口") | ||||
| @GetMapping("list") | @GetMapping("list") | ||||
| @@ -10,6 +10,8 @@ import java.util.HashMap; | |||||
| import java.util.List; | import java.util.List; | ||||
| import java.util.Map; | import java.util.Map; | ||||
| import org.slf4j.Logger; | |||||
| import org.slf4j.LoggerFactory; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.web.bind.annotation.GetMapping; | import org.springframework.web.bind.annotation.GetMapping; | ||||
| import org.springframework.web.bind.annotation.RequestMapping; | import org.springframework.web.bind.annotation.RequestMapping; | ||||
| @@ -30,7 +32,8 @@ import io.swagger.annotations.ApiOperation; | |||||
| @RestController | @RestController | ||||
| @RequestMapping("wxCUserData") | @RequestMapping("wxCUserData") | ||||
| @Api(description="会员首页报表数据") | @Api(description="会员首页报表数据") | ||||
| public class WxCUserDataController extends BaseController{ | |||||
| public class WxCUserDataController extends BaseController { | |||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||||
| @Autowired | @Autowired | ||||
| private WxCUserService wxCUserService; | private WxCUserService wxCUserService; | ||||
| @@ -1,41 +1,38 @@ | |||||
| package com.simple.controller; | package com.simple.controller; | ||||
| import org.apache.log4j.Logger; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.util.Assert; | |||||
| import org.springframework.web.bind.annotation.*; | |||||
| import com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| import com.simple.common.Result; | import com.simple.common.Result; | ||||
| import com.simple.common.ResultData; | import com.simple.common.ResultData; | ||||
| import com.simple.domain.po.WxCUserTags; | import com.simple.domain.po.WxCUserTags; | ||||
| import com.simple.service.WxCUserTagsService; | import com.simple.service.WxCUserTagsService; | ||||
| import io.swagger.annotations.ApiImplicitParam; | import io.swagger.annotations.ApiImplicitParam; | ||||
| import io.swagger.annotations.ApiImplicitParams; | import io.swagger.annotations.ApiImplicitParams; | ||||
| import io.swagger.annotations.ApiOperation; | import io.swagger.annotations.ApiOperation; | ||||
| import org.slf4j.Logger; | |||||
| import org.slf4j.LoggerFactory; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.web.bind.annotation.*; | |||||
| @RestController | @RestController | ||||
| @RequestMapping("wxCUserTags") | @RequestMapping("wxCUserTags") | ||||
| public class WxCUserTagsController extends BaseController | |||||
| { | |||||
| @Autowired | |||||
| public class WxCUserTagsController extends BaseController { | |||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||||
| @Autowired | |||||
| private WxCUserTagsService wxCUserTagsService; | private WxCUserTagsService wxCUserTagsService; | ||||
| private Logger logger = Logger.getLogger(WxCUserTagsController.class); | |||||
| @ApiOperation("分页列表接口") | |||||
| @ApiOperation("分页列表接口") | |||||
| @GetMapping("list") | @GetMapping("list") | ||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name="pageNum",value="页数",dataType="int", paramType = "query",required=true), | |||||
| @ApiImplicitParam(name="pageSize",value="每页条数",dataType="int", paramType = "query",required=true)}) | |||||
| public ResultData list(@ModelAttribute WxCUserTags wxCUserTags,Integer pageNum, Integer pageSize) { | |||||
| if (null == wxCUserTags) wxCUserTags = new WxCUserTags(); | |||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | |||||
| public ResultData list(@ModelAttribute WxCUserTags wxCUserTags, Integer pageNum, Integer pageSize) { | |||||
| if (null == wxCUserTags) wxCUserTags = new WxCUserTags(); | |||||
| final PageInfo<WxCUserTags> page = wxCUserTagsService.listAsPage(wxCUserTags, pageNum, pageSize); | final PageInfo<WxCUserTags> page = wxCUserTagsService.listAsPage(wxCUserTags, pageNum, pageSize); | ||||
| return new ResultData(page); | return new ResultData(page); | ||||
| } | } | ||||
| @ApiOperation("新增接口") | |||||
| @ApiOperation("新增接口") | |||||
| @PostMapping("add") | @PostMapping("add") | ||||
| public ResultData add(@RequestBody WxCUserTags wxCUserTags) { | public ResultData add(@RequestBody WxCUserTags wxCUserTags) { | ||||
| //Assert.notNull(wxCUserTags.getName(), "角色名不能为空"); | //Assert.notNull(wxCUserTags.getName(), "角色名不能为空"); | ||||
| @@ -53,19 +50,18 @@ public class WxCUserTagsController extends BaseController | |||||
| @ApiOperation("根据id删除接口") | @ApiOperation("根据id删除接口") | ||||
| @GetMapping("/del") | @GetMapping("/del") | ||||
| @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | |||||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | |||||
| public ResultData delete(Long id) { | public ResultData delete(Long id) { | ||||
| wxCUserTagsService.deleteById(id); | wxCUserTagsService.deleteById(id); | ||||
| return new ResultData(Result.SUCCESS, "删除成功", null); | return new ResultData(Result.SUCCESS, "删除成功", null); | ||||
| } | } | ||||
| @ApiOperation("根据id查询接口") | |||||
| @GetMapping("/findById") | |||||
| @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | |||||
| @ApiOperation("根据id查询接口") | |||||
| @GetMapping("/findById") | |||||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | |||||
| public ResultData findById(Long id) { | public ResultData findById(Long id) { | ||||
| return new ResultData(Result.SUCCESS,"查询成功",wxCUserTagsService.getById(id)); | |||||
| return new ResultData(Result.SUCCESS, "查询成功", wxCUserTagsService.getById(id)); | |||||
| } | } | ||||
| } | } | ||||
| @@ -6,11 +6,9 @@ import com.github.pagehelper.PageInfo; | |||||
| import com.simple.common.Result; | import com.simple.common.Result; | ||||
| import com.simple.common.ResultData; | import com.simple.common.ResultData; | ||||
| import com.simple.domain.po.WxCampaign; | import com.simple.domain.po.WxCampaign; | ||||
| import com.simple.domain.po.WxCoupon; | |||||
| import com.simple.domain.po.WxCouponChannel; | import com.simple.domain.po.WxCouponChannel; | ||||
| import com.simple.domain.vo.WxCouponChannelVo; | import com.simple.domain.vo.WxCouponChannelVo; | ||||
| import com.simple.enums.EnumCouponChannelType; | import com.simple.enums.EnumCouponChannelType; | ||||
| import com.simple.enums.EnumCouponStatus; | |||||
| import com.simple.service.WxCampaignService; | import com.simple.service.WxCampaignService; | ||||
| import com.simple.service.WxCouponChannelService; | import com.simple.service.WxCouponChannelService; | ||||
| import com.simple.service.WxCouponService; | import com.simple.service.WxCouponService; | ||||
| @@ -19,40 +17,39 @@ import io.swagger.annotations.ApiImplicitParam; | |||||
| import io.swagger.annotations.ApiImplicitParams; | import io.swagger.annotations.ApiImplicitParams; | ||||
| import io.swagger.annotations.ApiOperation; | import io.swagger.annotations.ApiOperation; | ||||
| import org.apache.commons.lang3.StringUtils; | import org.apache.commons.lang3.StringUtils; | ||||
| import org.apache.log4j.Logger; | |||||
| import org.slf4j.Logger; | |||||
| import org.slf4j.LoggerFactory; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.web.bind.annotation.*; | import org.springframework.web.bind.annotation.*; | ||||
| import java.util.ArrayList; | |||||
| import java.util.List; | import java.util.List; | ||||
| import static com.simple.domain.po.WxCampaign.Field.SortNum_ASC; | import static com.simple.domain.po.WxCampaign.Field.SortNum_ASC; | ||||
| @RestController | @RestController | ||||
| @RequestMapping("wxCampaign") | @RequestMapping("wxCampaign") | ||||
| @Api(description="促销和banner接口") | |||||
| public class WxCampaignController extends BaseController | |||||
| { | |||||
| @Autowired | |||||
| @Api(description = "促销和banner接口") | |||||
| public class WxCampaignController extends BaseController { | |||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||||
| @Autowired | |||||
| private WxCampaignService wxCampaignService; | private WxCampaignService wxCampaignService; | ||||
| @Autowired | |||||
| @Autowired | |||||
| private WxCouponService wxCouponService; | private WxCouponService wxCouponService; | ||||
| @Autowired | @Autowired | ||||
| private WxCouponChannelService wxCouponChannelService; | private WxCouponChannelService wxCouponChannelService; | ||||
| private Logger logger = Logger.getLogger(WxCampaignController.class); | |||||
| @ApiOperation("分页列表接口") | |||||
| @ApiOperation("分页列表接口") | |||||
| @GetMapping("list") | @GetMapping("list") | ||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name="pageNum",value="页数",dataType="int", paramType = "query",required=true), | |||||
| @ApiImplicitParam(name="pageSize",value="每页条数",dataType="int", paramType = "query",required=true)}) | |||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | |||||
| public ResultData list(@ModelAttribute WxCampaign wxCampaign, Integer pageNum, Integer pageSize) { | public ResultData list(@ModelAttribute WxCampaign wxCampaign, Integer pageNum, Integer pageSize) { | ||||
| if (null == wxCampaign) wxCampaign = new WxCampaign(); | |||||
| if(wxCampaign.getStatus()!=null&&wxCampaign.getStatus()==-1){ | |||||
| wxCampaign.setStatus(null); | |||||
| if (null == wxCampaign) wxCampaign = new WxCampaign(); | |||||
| if (wxCampaign.getStatus() != null && wxCampaign.getStatus() == -1) { | |||||
| wxCampaign.setStatus(null); | |||||
| } | } | ||||
| wxCampaign.setTenantId(getTenantId()); | wxCampaign.setTenantId(getTenantId()); | ||||
| wxCampaign.setSortColumns(SortNum_ASC); | wxCampaign.setSortColumns(SortNum_ASC); | ||||
| @@ -60,16 +57,16 @@ public class WxCampaignController extends BaseController | |||||
| return new ResultData(page); | return new ResultData(page); | ||||
| } | } | ||||
| @ApiOperation("新增接口") | |||||
| @ApiOperation("新增接口") | |||||
| @PostMapping("add") | @PostMapping("add") | ||||
| public ResultData add(@RequestBody WxCampaign wxCampaign) { | public ResultData add(@RequestBody WxCampaign wxCampaign) { | ||||
| //Assert.notNull(wxCampaign.getName(), "角色名不能为空"); | //Assert.notNull(wxCampaign.getName(), "角色名不能为空"); | ||||
| //Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名"); | //Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名"); | ||||
| // int sortNum = wxCampaignService.getMaxSortNum(getTenantId()); | // int sortNum = wxCampaignService.getMaxSortNum(getTenantId()); | ||||
| if(StringUtils.isNotBlank(wxCampaign.getCouponIds())) { | |||||
| if (StringUtils.isNotBlank(wxCampaign.getCouponIds())) { | |||||
| String[] arys = wxCampaign.getCouponIds().split(","); | String[] arys = wxCampaign.getCouponIds().split(","); | ||||
| wxCampaign.setCouponIds(JSON.toJSONString(arys)); | wxCampaign.setCouponIds(JSON.toJSONString(arys)); | ||||
| }else { | |||||
| } else { | |||||
| wxCampaign.setCouponIds(JSONArray.toJSONString(new String[0])); | wxCampaign.setCouponIds(JSONArray.toJSONString(new String[0])); | ||||
| } | } | ||||
| wxCampaign.setStatus(0); | wxCampaign.setStatus(0); | ||||
| @@ -82,10 +79,10 @@ public class WxCampaignController extends BaseController | |||||
| @ApiOperation("根据id更新接口") | @ApiOperation("根据id更新接口") | ||||
| @PostMapping("update") | @PostMapping("update") | ||||
| public ResultData update(@RequestBody WxCampaign wxCampaign) { | public ResultData update(@RequestBody WxCampaign wxCampaign) { | ||||
| if(StringUtils.isNotBlank(wxCampaign.getCouponIds())) { | |||||
| if (StringUtils.isNotBlank(wxCampaign.getCouponIds())) { | |||||
| String[] arys = wxCampaign.getCouponIds().split(","); | String[] arys = wxCampaign.getCouponIds().split(","); | ||||
| wxCampaign.setCouponIds(JSON.toJSONString(arys)); | wxCampaign.setCouponIds(JSON.toJSONString(arys)); | ||||
| }else { | |||||
| } else { | |||||
| wxCampaign.setCouponIds(JSONArray.toJSONString(new String[0])); | wxCampaign.setCouponIds(JSONArray.toJSONString(new String[0])); | ||||
| } | } | ||||
| wxCampaignService.saveOrUpdate(wxCampaign); | wxCampaignService.saveOrUpdate(wxCampaign); | ||||
| @@ -94,47 +91,47 @@ public class WxCampaignController extends BaseController | |||||
| @ApiOperation("根据id删除接口") | @ApiOperation("根据id删除接口") | ||||
| @GetMapping("/del") | @GetMapping("/del") | ||||
| @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | |||||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | |||||
| public ResultData delete(Long id) { | public ResultData delete(Long id) { | ||||
| wxCampaignService.deleteById(id); | wxCampaignService.deleteById(id); | ||||
| return new ResultData(Result.SUCCESS, "删除成功", null); | return new ResultData(Result.SUCCESS, "删除成功", null); | ||||
| } | } | ||||
| @ApiOperation("根据id查询接口") | |||||
| @GetMapping("/findById") | |||||
| @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | |||||
| @ApiOperation("根据id查询接口") | |||||
| @GetMapping("/findById") | |||||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | |||||
| public ResultData findById(Long id) { | public ResultData findById(Long id) { | ||||
| WxCampaign wxCampaign = wxCampaignService.getById(id); | |||||
| if (wxCampaign != null) { | |||||
| WxCouponChannel wxCouponChannel = new WxCouponChannel(); | |||||
| wxCouponChannel.setTenantId(getTenantId()); | |||||
| wxCouponChannel.setTargetAd(EnumCouponChannelType.COUPON_CHANNEL_ID_CAMPAIN.getCode()); | |||||
| wxCouponChannel.setSubTargetId(wxCampaign.getId()); | |||||
| wxCouponChannel.setStatus(0); | |||||
| List<WxCouponChannelVo> couponList = wxCouponChannelService.listAPI(wxCouponChannel); | |||||
| wxCampaign.setCoupons(couponList); | |||||
| } | |||||
| return new ResultData(Result.SUCCESS, "查询成功", wxCampaign); | |||||
| } | |||||
| WxCampaign wxCampaign = wxCampaignService.getById(id); | |||||
| if (wxCampaign != null) { | |||||
| WxCouponChannel wxCouponChannel = new WxCouponChannel(); | |||||
| wxCouponChannel.setTenantId(getTenantId()); | |||||
| wxCouponChannel.setTargetAd(EnumCouponChannelType.COUPON_CHANNEL_ID_CAMPAIN.getCode()); | |||||
| wxCouponChannel.setSubTargetId(wxCampaign.getId()); | |||||
| wxCouponChannel.setStatus(0); | |||||
| List<WxCouponChannelVo> couponList = wxCouponChannelService.listAPI(wxCouponChannel); | |||||
| wxCampaign.setCoupons(couponList); | |||||
| } | |||||
| return new ResultData(Result.SUCCESS, "查询成功", wxCampaign); | |||||
| } | |||||
| @ApiOperation("调整顺序") | @ApiOperation("调整顺序") | ||||
| @GetMapping("/move") | @GetMapping("/move") | ||||
| @ApiImplicitParams({ | @ApiImplicitParams({ | ||||
| @ApiImplicitParam(name="sourceId",value="",dataType="Long", paramType = "query",required=true), | |||||
| @ApiImplicitParam(name="targetId",value="",dataType="Long", paramType = "query",required=true)}) | |||||
| public ResultData move(Long sourceId,Long targetId) { | |||||
| WxCampaign source = wxCampaignService.getById(sourceId); | |||||
| @ApiImplicitParam(name = "sourceId", value = "", dataType = "Long", paramType = "query", required = true), | |||||
| @ApiImplicitParam(name = "targetId", value = "", dataType = "Long", paramType = "query", required = true)}) | |||||
| public ResultData move(Long sourceId, Long targetId) { | |||||
| WxCampaign source = wxCampaignService.getById(sourceId); | |||||
| WxCampaign target = wxCampaignService.getById(targetId); | WxCampaign target = wxCampaignService.getById(targetId); | ||||
| if(source==null||target==null){ | |||||
| if (source == null || target == null) { | |||||
| return new ResultData(Result.ERROR, "调整顺序失败", null); | return new ResultData(Result.ERROR, "调整顺序失败", null); | ||||
| } | } | ||||
| int temp =source.getSortNum(); | |||||
| int temp = source.getSortNum(); | |||||
| source.setSortNum(target.getSortNum()); | source.setSortNum(target.getSortNum()); | ||||
| target.setSortNum(temp); | target.setSortNum(temp); | ||||
| wxCampaignService.saveOrUpdate(source); | wxCampaignService.saveOrUpdate(source); | ||||
| wxCampaignService.saveOrUpdate(target); | wxCampaignService.saveOrUpdate(target); | ||||
| return new ResultData(Result.SUCCESS, "调整顺序成功", null); | return new ResultData(Result.SUCCESS, "调整顺序成功", null); | ||||
| } | } | ||||
| } | } | ||||
| @@ -1,11 +1,11 @@ | |||||
| package com.simple.controller; | package com.simple.controller; | ||||
| import com.alibaba.fastjson.JSON; | import com.alibaba.fastjson.JSON; | ||||
| import com.alibaba.fastjson.JSONObject; | |||||
| import com.simple.common.ErrorCode; | import com.simple.common.ErrorCode; | ||||
| import com.simple.common.Result; | import com.simple.common.Result; | ||||
| import com.simple.common.ResultData; | |||||
| import com.simple.domain.po.*; | |||||
| import com.simple.domain.po.WxCUserCar; | |||||
| import com.simple.domain.po.WxCarCmdLog; | |||||
| import com.simple.domain.po.WxPark; | |||||
| import com.simple.enums.EnumCarCmd; | import com.simple.enums.EnumCarCmd; | ||||
| import com.simple.enums.EnumCarVendor; | import com.simple.enums.EnumCarVendor; | ||||
| import com.simple.enums.EnumCouponSendType; | import com.simple.enums.EnumCouponSendType; | ||||
| @@ -13,11 +13,14 @@ import com.simple.enums.EnumETCPCode; | |||||
| import com.simple.service.*; | import com.simple.service.*; | ||||
| import com.simple.utils.ETCPUtil; | import com.simple.utils.ETCPUtil; | ||||
| import com.simple.utils.TJDCarUtil; | import com.simple.utils.TJDCarUtil; | ||||
| import io.swagger.annotations.ApiOperation; | |||||
| import org.apache.commons.lang3.StringUtils; | import org.apache.commons.lang3.StringUtils; | ||||
| import org.apache.log4j.Logger; | |||||
| import org.slf4j.Logger; | |||||
| import org.slf4j.LoggerFactory; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.web.bind.annotation.*; | |||||
| 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 java.util.Date; | import java.util.Date; | ||||
| import java.util.HashMap; | import java.util.HashMap; | ||||
| @@ -26,11 +29,10 @@ import java.util.Map; | |||||
| @RestController | @RestController | ||||
| @RequestMapping("/carCallback") | @RequestMapping("/carCallback") | ||||
| public class WxCarCallBackController extends BaseController | |||||
| { | |||||
| private Logger logger = Logger.getLogger(WxCarCallBackController.class); | |||||
| public class WxCarCallBackController extends BaseController { | |||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||||
| ETCPUtil etcp = new ETCPUtil(); | |||||
| ETCPUtil etcp = new ETCPUtil(); | |||||
| TJDCarUtil tjd = new TJDCarUtil(); | TJDCarUtil tjd = new TJDCarUtil(); | ||||
| @@ -52,19 +54,19 @@ public class WxCarCallBackController extends BaseController | |||||
| /** | /** | ||||
| * ETCP 车辆入场通知 | * ETCP 车辆入场通知 | ||||
| * { | * { | ||||
| * "synId": "4ebd80ff-cfcf-462a-94cb-727e9fa9547c", | |||||
| * "plateNumber": "渝 ATX061", | |||||
| * "parkName": "ETCP 智慧停车场", | |||||
| * "parkId": "1", | |||||
| * "entranceTime": "2017-08-20 12:59:54", | |||||
| * "userType": "76", | |||||
| * "pushTime": "2017-08-20 12:59:57", | |||||
| * "fixParkingId": "U7", | |||||
| * "remainingDays": "11" | |||||
| * "synId": "4ebd80ff-cfcf-462a-94cb-727e9fa9547c", | |||||
| * "plateNumber": "渝 ATX061", | |||||
| * "parkName": "ETCP 智慧停车场", | |||||
| * "parkId": "1", | |||||
| * "entranceTime": "2017-08-20 12:59:54", | |||||
| * "userType": "76", | |||||
| * "pushTime": "2017-08-20 12:59:57", | |||||
| * "fixParkingId": "U7", | |||||
| * "remainingDays": "11" | |||||
| * } | * } | ||||
| */ | |||||
| */ | |||||
| @PostMapping(value = "/etcpParkInCallback") | @PostMapping(value = "/etcpParkInCallback") | ||||
| public Result etcpParkInCallback(@RequestBody Map<String,String> paramMap) { | |||||
| public Result etcpParkInCallback(@RequestBody Map<String, String> paramMap) { | |||||
| logger.info("etcpParkInCallback: " + paramMap.toString()); | logger.info("etcpParkInCallback: " + paramMap.toString()); | ||||
| Date currentDate = new Date(); | Date currentDate = new Date(); | ||||
| WxCarCmdLog wxCarCmdLog = new WxCarCmdLog(); | WxCarCmdLog wxCarCmdLog = new WxCarCmdLog(); | ||||
| @@ -82,7 +84,7 @@ public class WxCarCallBackController extends BaseController | |||||
| parkQ.setParkId(etcpParkId); | parkQ.setParkId(etcpParkId); | ||||
| WxPark park = wxParkService.getByObj(parkQ); | WxPark park = wxParkService.getByObj(parkQ); | ||||
| if (park == null) { | if (park == null) { | ||||
| logger.error("etcpParkInCallback: ETCP车场未找到"+ etcpParkId); | |||||
| logger.error("etcpParkInCallback: ETCP车场未找到" + etcpParkId); | |||||
| //return new Result(ErrorCode.CAR_PARK_NOT_FOUND.getCode(), "ETCP车场未找到"+ etcpParkId); | //return new Result(ErrorCode.CAR_PARK_NOT_FOUND.getCode(), "ETCP车场未找到"+ etcpParkId); | ||||
| } else { | } else { | ||||
| tenantId = park.getTenantId(); | tenantId = park.getTenantId(); | ||||
| @@ -92,8 +94,8 @@ public class WxCarCallBackController extends BaseController | |||||
| try { | try { | ||||
| wxCarCmdLogService.saveOrUpdate(wxCarCmdLog); | wxCarCmdLogService.saveOrUpdate(wxCarCmdLog); | ||||
| } catch (Exception e) { | } catch (Exception e) { | ||||
| logger.error("etcpParkInCallback: 入库错误 "+ paramMap.toString()); | |||||
| return new Result(ErrorCode.DB_FAIL.getCode(), "入库错误"+paramMap.toString()); | |||||
| logger.error("etcpParkInCallback: 入库错误 " + paramMap.toString()); | |||||
| return new Result(ErrorCode.DB_FAIL.getCode(), "入库错误" + paramMap.toString()); | |||||
| } | } | ||||
| // 停车发券 | // 停车发券 | ||||
| @@ -106,7 +108,7 @@ public class WxCarCallBackController extends BaseController | |||||
| userCarQ.setVendorType(EnumCarVendor.CAR_ETCP.getCode()); | userCarQ.setVendorType(EnumCarVendor.CAR_ETCP.getCode()); | ||||
| // TODO 可能多用户关联同一张车牌 | // TODO 可能多用户关联同一张车牌 | ||||
| List<WxCUserCar> userCarList = wxCUserCarService.getList(userCarQ); | List<WxCUserCar> userCarList = wxCUserCarService.getList(userCarQ); | ||||
| for(WxCUserCar userCar: userCarList) { | |||||
| for (WxCUserCar userCar : userCarList) { | |||||
| wxCouponSendService.sendCouponToUser(tenantId, userCar.getCUserId(), EnumCouponSendType.CAR_STOP.getCode()); | wxCouponSendService.sendCouponToUser(tenantId, userCar.getCUserId(), EnumCouponSendType.CAR_STOP.getCode()); | ||||
| } | } | ||||
| } | } | ||||
| @@ -118,23 +120,23 @@ public class WxCarCallBackController extends BaseController | |||||
| /** | /** | ||||
| * ETCP 车辆出场通知 | * ETCP 车辆出场通知 | ||||
| * { | * { | ||||
| * "synId": "fd92f645-880e-4c2a-9d7d-7081a2488181", | |||||
| * "plateNumber": "渝 ATX061", | |||||
| * "parkName": "ETCP 智慧停车场", | |||||
| * "parkId": "1", | |||||
| * "entranceTime": "2017-08-17 18:44:19", | |||||
| * "userType": "76", | |||||
| * "pushTime": "2017-08-20 11:57:51", | |||||
| * "exitTime": "2017-08-19 12:07:19", | |||||
| * "stayedTime": 148980, | |||||
| * "receivableFee": 0, | |||||
| * "paidServiceFee": 0, | |||||
| * "fixParkingId": "U7", | |||||
| * "remainingDays": "12" | |||||
| * "synId": "fd92f645-880e-4c2a-9d7d-7081a2488181", | |||||
| * "plateNumber": "渝 ATX061", | |||||
| * "parkName": "ETCP 智慧停车场", | |||||
| * "parkId": "1", | |||||
| * "entranceTime": "2017-08-17 18:44:19", | |||||
| * "userType": "76", | |||||
| * "pushTime": "2017-08-20 11:57:51", | |||||
| * "exitTime": "2017-08-19 12:07:19", | |||||
| * "stayedTime": 148980, | |||||
| * "receivableFee": 0, | |||||
| * "paidServiceFee": 0, | |||||
| * "fixParkingId": "U7", | |||||
| * "remainingDays": "12" | |||||
| * } | * } | ||||
| */ | |||||
| */ | |||||
| @PostMapping(value = "/etcpParkOutCallback") | @PostMapping(value = "/etcpParkOutCallback") | ||||
| public Result etcpParkOutCallback(@RequestBody Map<String,String> paramMap) { | |||||
| public Result etcpParkOutCallback(@RequestBody Map<String, String> paramMap) { | |||||
| logger.info("etcpParkOutCallback: " + paramMap.toString()); | logger.info("etcpParkOutCallback: " + paramMap.toString()); | ||||
| Date currentDate = new Date(); | Date currentDate = new Date(); | ||||
| @@ -151,7 +153,7 @@ public class WxCarCallBackController extends BaseController | |||||
| parkQ.setParkId(etcpParkId); | parkQ.setParkId(etcpParkId); | ||||
| WxPark park = wxParkService.getByObj(parkQ); | WxPark park = wxParkService.getByObj(parkQ); | ||||
| if (park == null) { | if (park == null) { | ||||
| logger.error("etcpParkOutCallback: ETCP车场未找到 "+ etcpParkId); | |||||
| logger.error("etcpParkOutCallback: ETCP车场未找到 " + etcpParkId); | |||||
| //return new Result(ErrorCode.CAR_PARK_NOT_FOUND.getCode(), "ETCP车场未找到"+ etcpParkId); | //return new Result(ErrorCode.CAR_PARK_NOT_FOUND.getCode(), "ETCP车场未找到"+ etcpParkId); | ||||
| } else { | } else { | ||||
| wxCarCmdLog.setTenantId(park.getTenantId()); | wxCarCmdLog.setTenantId(park.getTenantId()); | ||||
| @@ -160,8 +162,8 @@ public class WxCarCallBackController extends BaseController | |||||
| try { | try { | ||||
| wxCarCmdLogService.saveOrUpdate(wxCarCmdLog); | wxCarCmdLogService.saveOrUpdate(wxCarCmdLog); | ||||
| } catch (Exception e) { | } catch (Exception e) { | ||||
| logger.error("etcpParkOutCallback: 入库错误 "+ paramMap.toString()); | |||||
| return new Result(ErrorCode.DB_FAIL.getCode(), "入库错误"+paramMap.toString()); | |||||
| logger.error("etcpParkOutCallback: 入库错误 " + paramMap.toString()); | |||||
| return new Result(ErrorCode.DB_FAIL.getCode(), "入库错误" + paramMap.toString()); | |||||
| } | } | ||||
| // TODO 如果此车关联了停车优免券,自动把优免券设为已使用 | // TODO 如果此车关联了停车优免券,自动把优免券设为已使用 | ||||
| @@ -172,12 +174,12 @@ public class WxCarCallBackController extends BaseController | |||||
| /** | /** | ||||
| * ETCP 车辆解绑通知 | * ETCP 车辆解绑通知 | ||||
| * { | * { | ||||
| * "plateNumber": "渝 ATX061", | |||||
| * "time": "2017-08-20 11:57:51" | |||||
| * "plateNumber": "渝 ATX061", | |||||
| * "time": "2017-08-20 11:57:51" | |||||
| * } | * } | ||||
| */ | |||||
| */ | |||||
| @PostMapping(value = "/etcpUnbindCarCallBack") | @PostMapping(value = "/etcpUnbindCarCallBack") | ||||
| public Result etcpUnbindCarCallBack(@RequestBody Map<String,String> paramMap) { | |||||
| public Result etcpUnbindCarCallBack(@RequestBody Map<String, String> paramMap) { | |||||
| logger.info("etcpUnbindCarCallBack: " + paramMap.toString()); | logger.info("etcpUnbindCarCallBack: " + paramMap.toString()); | ||||
| String carNumber = paramMap.get("plateNumber"); | String carNumber = paramMap.get("plateNumber"); | ||||
| @@ -193,8 +195,8 @@ public class WxCarCallBackController extends BaseController | |||||
| try { | try { | ||||
| wxCarCmdLogService.saveOrUpdate(wxCarCmdLog); | wxCarCmdLogService.saveOrUpdate(wxCarCmdLog); | ||||
| } catch (Exception e) { | } catch (Exception e) { | ||||
| logger.error("etcpUnbindCarCallBack: 入库错误 "+ paramMap.toString()); | |||||
| return new Result(ErrorCode.DB_FAIL.getCode(), "入库错误"+paramMap.toString()); | |||||
| logger.error("etcpUnbindCarCallBack: 入库错误 " + paramMap.toString()); | |||||
| return new Result(ErrorCode.DB_FAIL.getCode(), "入库错误" + paramMap.toString()); | |||||
| } | } | ||||
| WxCUserCar userCarQ = new WxCUserCar(); | WxCUserCar userCarQ = new WxCUserCar(); | ||||
| @@ -213,16 +215,16 @@ public class WxCarCallBackController extends BaseController | |||||
| /** | /** | ||||
| * ETCP 主动支付结果通知 | * ETCP 主动支付结果通知 | ||||
| * { | * { | ||||
| * "plateNumber": "渝 ATX061", | |||||
| * "orderId": "fd92f645-880e-4c2a-9d7d-7081a2488181", | |||||
| * "fee": 7.65, | |||||
| * "paidServiceFee": 0.07, | |||||
| * "coupon": 0, | |||||
| * "time": "2017-08-20 11:57:51" | |||||
| * "plateNumber": "渝 ATX061", | |||||
| * "orderId": "fd92f645-880e-4c2a-9d7d-7081a2488181", | |||||
| * "fee": 7.65, | |||||
| * "paidServiceFee": 0.07, | |||||
| * "coupon": 0, | |||||
| * "time": "2017-08-20 11:57:51" | |||||
| * } | * } | ||||
| */ | |||||
| */ | |||||
| @PostMapping(value = "/etcpPaidCallback") | @PostMapping(value = "/etcpPaidCallback") | ||||
| public Result etcpPaidCallback(@RequestBody Map<String,String> paramMap) { | |||||
| public Result etcpPaidCallback(@RequestBody Map<String, String> paramMap) { | |||||
| logger.info("etcpPaidCallback: " + paramMap.toString()); | logger.info("etcpPaidCallback: " + paramMap.toString()); | ||||
| String carNumber = paramMap.get("plateNumber"); | String carNumber = paramMap.get("plateNumber"); | ||||
| @@ -238,8 +240,8 @@ public class WxCarCallBackController extends BaseController | |||||
| try { | try { | ||||
| wxCarCmdLogService.saveOrUpdate(wxCarCmdLog); | wxCarCmdLogService.saveOrUpdate(wxCarCmdLog); | ||||
| } catch (Exception e) { | } catch (Exception e) { | ||||
| logger.error("etcpPaidCallback: 入库错误 "+ paramMap.toString()); | |||||
| return new Result(ErrorCode.DB_FAIL.getCode(), "入库错误"+paramMap.toString()); | |||||
| logger.error("etcpPaidCallback: 入库错误 " + paramMap.toString()); | |||||
| return new Result(ErrorCode.DB_FAIL.getCode(), "入库错误" + paramMap.toString()); | |||||
| } | } | ||||
| // 营销 - 短信 | // 营销 - 短信 | ||||
| @@ -250,23 +252,23 @@ public class WxCarCallBackController extends BaseController | |||||
| /** | /** | ||||
| * TJD 车辆入场通知 | * TJD 车辆入场通知 | ||||
| * { | * { | ||||
| * "tradeId": "5836b8b52ada463ebc6199579f029565", | |||||
| * "outCarId": "45454545454", | |||||
| * "carNum": "京A45413", | |||||
| * "carNumColor ": "blue", | |||||
| * "inDt": "20170319202020", | |||||
| * "parkName": "测试停车场", | |||||
| * "parkId": "5836b8b52ada463ebc6199579f029561", | |||||
| * "lon": "74.000272", | |||||
| * "lat": "159.768703", | |||||
| * "wLon": "123.523032", | |||||
| * "wLat": "35.430735", | |||||
| * "payUrl": "http://prep.tingjiandan.com/tcweixin/letter/prePay/payInPark.html?prePayType=16&channel=10001", | |||||
| * "canFindCar": "0" | |||||
| * "tradeId": "5836b8b52ada463ebc6199579f029565", | |||||
| * "outCarId": "45454545454", | |||||
| * "carNum": "京A45413", | |||||
| * "carNumColor ": "blue", | |||||
| * "inDt": "20170319202020", | |||||
| * "parkName": "测试停车场", | |||||
| * "parkId": "5836b8b52ada463ebc6199579f029561", | |||||
| * "lon": "74.000272", | |||||
| * "lat": "159.768703", | |||||
| * "wLon": "123.523032", | |||||
| * "wLat": "35.430735", | |||||
| * "payUrl": "http://prep.tingjiandan.com/tcweixin/letter/prePay/payInPark.html?prePayType=16&channel=10001", | |||||
| * "canFindCar": "0" | |||||
| * } | * } | ||||
| */ | |||||
| */ | |||||
| @RequestMapping(value = "/tjdParkInCallback") | @RequestMapping(value = "/tjdParkInCallback") | ||||
| public Map tjdParkInCallback(@RequestBody Map<String,String> paramMap) { | |||||
| public Map tjdParkInCallback(@RequestBody Map<String, String> paramMap) { | |||||
| logger.info("tjdParkInCallback: " + paramMap.toString()); | logger.info("tjdParkInCallback: " + paramMap.toString()); | ||||
| Map map = new HashMap(); | Map map = new HashMap(); | ||||
| @@ -278,9 +280,9 @@ public class WxCarCallBackController extends BaseController | |||||
| parkQ.setParkId(tjdParkId); | parkQ.setParkId(tjdParkId); | ||||
| WxPark park = wxParkService.getByObj(parkQ); | WxPark park = wxParkService.getByObj(parkQ); | ||||
| if (park == null) { | if (park == null) { | ||||
| logger.error("tjdParkInCallback: 停简单车场未找到"+ tjdParkId); | |||||
| logger.error("tjdParkInCallback: 停简单车场未找到" + tjdParkId); | |||||
| map.put("isSuccess", "0"); | map.put("isSuccess", "0"); | ||||
| map.put("errorMsg", "停简单车场未找到"+ tjdParkId); | |||||
| map.put("errorMsg", "停简单车场未找到" + tjdParkId); | |||||
| return map; | return map; | ||||
| } | } | ||||
| @@ -295,10 +297,10 @@ public class WxCarCallBackController extends BaseController | |||||
| try { | try { | ||||
| wxCarCmdLogService.saveOrUpdate(wxCarCmdLog); | wxCarCmdLogService.saveOrUpdate(wxCarCmdLog); | ||||
| } catch (Exception e) { | } catch (Exception e) { | ||||
| logger.error("tjdParkInCallback: 入库错误"+ paramMap.toString()); | |||||
| logger.error("tjdParkInCallback: 入库错误" + paramMap.toString()); | |||||
| map.put("isSuccess", "0"); | map.put("isSuccess", "0"); | ||||
| map.put("errorMsg", "入库错误"+ paramMap.toString()); | |||||
| return map; | |||||
| map.put("errorMsg", "入库错误" + paramMap.toString()); | |||||
| return map; | |||||
| } | } | ||||
| map.put("isSuccess", "0"); | map.put("isSuccess", "0"); | ||||
| @@ -309,17 +311,17 @@ public class WxCarCallBackController extends BaseController | |||||
| /** | /** | ||||
| * TJD 车辆出场通知 | * TJD 车辆出场通知 | ||||
| * { | * { | ||||
| * "tradeId": "5836b8b52ada463ebc6199579f029565", | |||||
| * "outDt": "20170319232020", | |||||
| * "lon": "74.000272", | |||||
| * "lat": "159.768703", | |||||
| * "wLon": "123.523032", | |||||
| * "wLat": "35.430735", | |||||
| * "parkAmount": "5.20" | |||||
| * "tradeId": "5836b8b52ada463ebc6199579f029565", | |||||
| * "outDt": "20170319232020", | |||||
| * "lon": "74.000272", | |||||
| * "lat": "159.768703", | |||||
| * "wLon": "123.523032", | |||||
| * "wLat": "35.430735", | |||||
| * "parkAmount": "5.20" | |||||
| * } | * } | ||||
| */ | |||||
| */ | |||||
| @RequestMapping(value = "/tjdParkoutCallback") | @RequestMapping(value = "/tjdParkoutCallback") | ||||
| public Map tjdParkOutCallback(@RequestBody Map<String,String> paramMap) { | |||||
| public Map tjdParkOutCallback(@RequestBody Map<String, String> paramMap) { | |||||
| logger.info("tjdParkoutCallback: " + paramMap.toString()); | logger.info("tjdParkoutCallback: " + paramMap.toString()); | ||||
| Map map = new HashMap(); | Map map = new HashMap(); | ||||
| @@ -336,15 +338,15 @@ public class WxCarCallBackController extends BaseController | |||||
| try { | try { | ||||
| wxCarCmdLogService.saveOrUpdate(wxCarCmdLog); | wxCarCmdLogService.saveOrUpdate(wxCarCmdLog); | ||||
| } catch (Exception e) { | } catch (Exception e) { | ||||
| logger.error("tjdParkoutCallback: 入库错误"+ paramMap.toString()); | |||||
| logger.error("tjdParkoutCallback: 入库错误" + paramMap.toString()); | |||||
| map.put("isSuccess", "0"); | map.put("isSuccess", "0"); | ||||
| map.put("errorMsg", "入库错误"+ paramMap.toString()); | |||||
| return map; | |||||
| map.put("errorMsg", "入库错误" + paramMap.toString()); | |||||
| return map; | |||||
| } | } | ||||
| map.put("isSuccess", "0"); | map.put("isSuccess", "0"); | ||||
| map.put("errorMsg", ""); | map.put("errorMsg", ""); | ||||
| return map; | return map; | ||||
| } | } | ||||
| } | } | ||||
| @@ -1,40 +1,38 @@ | |||||
| package com.simple.controller; | package com.simple.controller; | ||||
| import org.apache.log4j.Logger; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.web.bind.annotation.*; | |||||
| import com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| import com.simple.common.Result; | import com.simple.common.Result; | ||||
| import com.simple.common.ResultData; | import com.simple.common.ResultData; | ||||
| import com.simple.domain.po.WxCarCmdLog; | import com.simple.domain.po.WxCarCmdLog; | ||||
| import com.simple.service.WxCarCmdLogService; | import com.simple.service.WxCarCmdLogService; | ||||
| import io.swagger.annotations.ApiImplicitParam; | import io.swagger.annotations.ApiImplicitParam; | ||||
| import io.swagger.annotations.ApiImplicitParams; | import io.swagger.annotations.ApiImplicitParams; | ||||
| import io.swagger.annotations.ApiOperation; | import io.swagger.annotations.ApiOperation; | ||||
| import org.slf4j.Logger; | |||||
| import org.slf4j.LoggerFactory; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.web.bind.annotation.*; | |||||
| @RestController | @RestController | ||||
| @RequestMapping("wxCarCmdLogs") | @RequestMapping("wxCarCmdLogs") | ||||
| public class WxCarCmdLogController extends BaseController | |||||
| { | |||||
| private Logger logger = Logger.getLogger(WxCarCmdLogController.class); | |||||
| public class WxCarCmdLogController extends BaseController { | |||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||||
| @Autowired | |||||
| @Autowired | |||||
| private WxCarCmdLogService wxCarCmdLogService; | private WxCarCmdLogService wxCarCmdLogService; | ||||
| @ApiOperation("分页列表接口") | |||||
| @ApiOperation("分页列表接口") | |||||
| @GetMapping("list") | @GetMapping("list") | ||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name="pageNum",value="页数",dataType="int", paramType = "query",required=true), | |||||
| @ApiImplicitParam(name="pageSize",value="每页条数",dataType="int", paramType = "query",required=true)}) | |||||
| public ResultData list(@ModelAttribute WxCarCmdLog wxCarCmdLogs,Integer pageNum, Integer pageSize) { | |||||
| if (null == wxCarCmdLogs) wxCarCmdLogs = new WxCarCmdLog(); | |||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | |||||
| public ResultData list(@ModelAttribute WxCarCmdLog wxCarCmdLogs, Integer pageNum, Integer pageSize) { | |||||
| if (null == wxCarCmdLogs) wxCarCmdLogs = new WxCarCmdLog(); | |||||
| final PageInfo<WxCarCmdLog> page = wxCarCmdLogService.listAsPage(wxCarCmdLogs, pageNum, pageSize); | final PageInfo<WxCarCmdLog> page = wxCarCmdLogService.listAsPage(wxCarCmdLogs, pageNum, pageSize); | ||||
| return new ResultData(page); | return new ResultData(page); | ||||
| } | } | ||||
| @ApiOperation("新增接口") | |||||
| @ApiOperation("新增接口") | |||||
| @PostMapping("add") | @PostMapping("add") | ||||
| public ResultData add(@RequestBody WxCarCmdLog wxCarCmdLog) { | public ResultData add(@RequestBody WxCarCmdLog wxCarCmdLog) { | ||||
| //Assert.notNull(wxCarCmdLogs.getName(), "角色名不能为空"); | //Assert.notNull(wxCarCmdLogs.getName(), "角色名不能为空"); | ||||
| @@ -52,19 +50,18 @@ public class WxCarCmdLogController extends BaseController | |||||
| @ApiOperation("根据id删除接口") | @ApiOperation("根据id删除接口") | ||||
| @GetMapping("/del") | @GetMapping("/del") | ||||
| @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | |||||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | |||||
| public ResultData delete(Long id) { | public ResultData delete(Long id) { | ||||
| wxCarCmdLogService.deleteById(id); | wxCarCmdLogService.deleteById(id); | ||||
| return new ResultData(Result.SUCCESS, "删除成功", null); | return new ResultData(Result.SUCCESS, "删除成功", null); | ||||
| } | } | ||||
| @ApiOperation("根据id查询接口") | |||||
| @GetMapping("/findById") | |||||
| @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | |||||
| @ApiOperation("根据id查询接口") | |||||
| @GetMapping("/findById") | |||||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | |||||
| public ResultData findById(Long id) { | public ResultData findById(Long id) { | ||||
| return new ResultData(Result.SUCCESS,"查询成功",wxCarCmdLogService.getById(id)); | |||||
| return new ResultData(Result.SUCCESS, "查询成功", wxCarCmdLogService.getById(id)); | |||||
| } | } | ||||
| } | } | ||||
| @@ -1,16 +1,12 @@ | |||||
| package com.simple.controller; | package com.simple.controller; | ||||
| import com.alibaba.fastjson.JSON; | import com.alibaba.fastjson.JSON; | ||||
| import com.alibaba.fastjson.JSONArray; | |||||
| import com.alibaba.fastjson.JSONObject; | import com.alibaba.fastjson.JSONObject; | ||||
| import com.simple.common.ErrorCode; | import com.simple.common.ErrorCode; | ||||
| import com.simple.common.Result; | |||||
| import com.simple.common.ResultData; | import com.simple.common.ResultData; | ||||
| import com.simple.domain.dto.WxCounponDto; | |||||
| import com.simple.domain.dto.WxCouponCarDto; | import com.simple.domain.dto.WxCouponCarDto; | ||||
| import com.simple.domain.po.*; | import com.simple.domain.po.*; | ||||
| import com.simple.domain.vo.WxCouponCarVo; | import com.simple.domain.vo.WxCouponCarVo; | ||||
| import com.simple.enums.EnumCarCmd; | |||||
| import com.simple.enums.EnumCarVendor; | import com.simple.enums.EnumCarVendor; | ||||
| import com.simple.enums.EnumCouponStatus; | import com.simple.enums.EnumCouponStatus; | ||||
| import com.simple.service.*; | import com.simple.service.*; | ||||
| @@ -19,26 +15,22 @@ import com.simple.utils.TJDCarUtil; | |||||
| import io.swagger.annotations.ApiImplicitParam; | import io.swagger.annotations.ApiImplicitParam; | ||||
| import io.swagger.annotations.ApiImplicitParams; | import io.swagger.annotations.ApiImplicitParams; | ||||
| import io.swagger.annotations.ApiOperation; | import io.swagger.annotations.ApiOperation; | ||||
| import io.swagger.models.auth.In; | |||||
| import org.apache.commons.lang3.StringUtils; | import org.apache.commons.lang3.StringUtils; | ||||
| import org.apache.log4j.Logger; | |||||
| import org.apache.poi.hmef.attribute.MAPIAttribute; | |||||
| import org.omg.PortableInterceptor.INACTIVE; | |||||
| import org.slf4j.Logger; | |||||
| import org.slf4j.LoggerFactory; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.web.bind.annotation.*; | import org.springframework.web.bind.annotation.*; | ||||
| import java.util.Date; | import java.util.Date; | ||||
| import java.util.HashMap; | import java.util.HashMap; | ||||
| import java.util.List; | |||||
| import java.util.Map; | import java.util.Map; | ||||
| @RestController | @RestController | ||||
| @RequestMapping("/car") | @RequestMapping("/car") | ||||
| public class WxCarController extends BaseController | |||||
| { | |||||
| private Logger logger = Logger.getLogger(WxCarController.class); | |||||
| public class WxCarController extends BaseController { | |||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||||
| ETCPUtil etcp = new ETCPUtil(); | |||||
| ETCPUtil etcp = new ETCPUtil(); | |||||
| TJDCarUtil tjd = new TJDCarUtil(); | TJDCarUtil tjd = new TJDCarUtil(); | ||||
| @@ -69,7 +61,7 @@ public class WxCarController extends BaseController | |||||
| return wxPark; | return wxPark; | ||||
| } | } | ||||
| @ApiOperation(value = "获取车场支持的厂家",notes="{}") | |||||
| @ApiOperation(value = "获取车场支持的厂家", notes = "{}") | |||||
| @GetMapping("/getVendor") | @GetMapping("/getVendor") | ||||
| public ResultData getVendor() { | public ResultData getVendor() { | ||||
| MallUserInfo user = getUser(); | MallUserInfo user = getUser(); | ||||
| @@ -121,9 +113,9 @@ public class WxCarController extends BaseController | |||||
| " ]}}\n") | " ]}}\n") | ||||
| @GetMapping("/quanTemplate") | @GetMapping("/quanTemplate") | ||||
| @ApiImplicitParams({ | @ApiImplicitParams({ | ||||
| @ApiImplicitParam(name="merchantId",value="商户ID",dataType="String", paramType = "query",required=true), | |||||
| @ApiImplicitParam(name="pageNum",value="页数",dataType="int", paramType = "query",required=true), | |||||
| @ApiImplicitParam(name="pageSize",value="每页条数",dataType="int", paramType = "query",required=true)}) | |||||
| @ApiImplicitParam(name = "merchantId", value = "商户ID", dataType = "String", paramType = "query", required = true), | |||||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | |||||
| public ResultData quanTemplate(String merchantId, Integer pageNum, Integer pageSize) { | public ResultData quanTemplate(String merchantId, Integer pageNum, Integer pageSize) { | ||||
| logger.info("quanTemplate: " + merchantId); | logger.info("quanTemplate: " + merchantId); | ||||
| MallUserInfo user = getUser(); | MallUserInfo user = getUser(); | ||||
| @@ -216,16 +208,16 @@ public class WxCarController extends BaseController | |||||
| WxCoupon wxCoupon = new WxCoupon(); | WxCoupon wxCoupon = new WxCoupon(); | ||||
| wxCoupon.setTenantId(user.getTenantId()); | wxCoupon.setTenantId(user.getTenantId()); | ||||
| wxCoupon.setMerchantId(coupon.getMerchantId()); | wxCoupon.setMerchantId(coupon.getMerchantId()); | ||||
| if(StringUtils.isNotEmpty(coupon.getSalePriceStr())){ | |||||
| wxCoupon.setSalePrice((int)(Double.parseDouble(coupon.getSalePriceStr())*100)); | |||||
| if (StringUtils.isNotEmpty(coupon.getSalePriceStr())) { | |||||
| wxCoupon.setSalePrice((int) (Double.parseDouble(coupon.getSalePriceStr()) * 100)); | |||||
| } | } | ||||
| if(StringUtils.isNotEmpty(coupon.getUsePriceStr())){ | |||||
| wxCoupon.setUsePrice((int)(Double.parseDouble(coupon.getUsePriceStr())*100)); | |||||
| if (StringUtils.isNotEmpty(coupon.getUsePriceStr())) { | |||||
| wxCoupon.setUsePrice((int) (Double.parseDouble(coupon.getUsePriceStr()) * 100)); | |||||
| } | } | ||||
| if(StringUtils.isNotEmpty(coupon.getPriceStr())){ | |||||
| wxCoupon.setPrice((int)(Double.parseDouble(coupon.getPriceStr())*100)); | |||||
| if (StringUtils.isNotEmpty(coupon.getPriceStr())) { | |||||
| wxCoupon.setPrice((int) (Double.parseDouble(coupon.getPriceStr()) * 100)); | |||||
| } | } | ||||
| if(StringUtils.isNotBlank(coupon.getBusiness())) { | |||||
| if (StringUtils.isNotBlank(coupon.getBusiness())) { | |||||
| String[] arys = coupon.getBusiness().split(","); | String[] arys = coupon.getBusiness().split(","); | ||||
| wxCoupon.setBusiness(JSON.toJSONString(arys)); | wxCoupon.setBusiness(JSON.toJSONString(arys)); | ||||
| } | } | ||||
| @@ -278,7 +270,7 @@ public class WxCarController extends BaseController | |||||
| @ApiOperation("优免券模板已分配总数") | @ApiOperation("优免券模板已分配总数") | ||||
| @GetMapping("/templateAmtCount") | @GetMapping("/templateAmtCount") | ||||
| @ApiImplicitParams({ | @ApiImplicitParams({ | ||||
| @ApiImplicitParam(name="templateId",value="模板ID",dataType="Long", paramType = "query",required=true)}) | |||||
| @ApiImplicitParam(name = "templateId", value = "模板ID", dataType = "Long", paramType = "query", required = true)}) | |||||
| public ResultData getTemplateAmountSum(Long templateId) { | public ResultData getTemplateAmountSum(Long templateId) { | ||||
| Map map = new HashMap(); | Map map = new HashMap(); | ||||
| Integer amountCount = 0; | Integer amountCount = 0; | ||||
| @@ -294,7 +286,7 @@ public class WxCarController extends BaseController | |||||
| @ApiOperation("优免券模板库存总数") | @ApiOperation("优免券模板库存总数") | ||||
| @GetMapping("/templateAvaiCount") | @GetMapping("/templateAvaiCount") | ||||
| @ApiImplicitParams({ | @ApiImplicitParams({ | ||||
| @ApiImplicitParam(name="templateId",value="模板ID",dataType="Long", paramType = "query",required=true)}) | |||||
| @ApiImplicitParam(name = "templateId", value = "模板ID", dataType = "Long", paramType = "query", required = true)}) | |||||
| public ResultData getTemplateAvailSum(Long templateId) { | public ResultData getTemplateAvailSum(Long templateId) { | ||||
| Map map = new HashMap(); | Map map = new HashMap(); | ||||
| Integer availCount = 0; | Integer availCount = 0; | ||||
| @@ -1,41 +1,38 @@ | |||||
| package com.simple.controller; | package com.simple.controller; | ||||
| import org.apache.log4j.Logger; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.util.Assert; | |||||
| import org.springframework.web.bind.annotation.*; | |||||
| import com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| import com.simple.common.Result; | import com.simple.common.Result; | ||||
| import com.simple.common.ResultData; | import com.simple.common.ResultData; | ||||
| import com.simple.domain.po.WxChannel; | import com.simple.domain.po.WxChannel; | ||||
| import com.simple.service.WxChannelService; | import com.simple.service.WxChannelService; | ||||
| import io.swagger.annotations.ApiImplicitParam; | import io.swagger.annotations.ApiImplicitParam; | ||||
| import io.swagger.annotations.ApiImplicitParams; | import io.swagger.annotations.ApiImplicitParams; | ||||
| import io.swagger.annotations.ApiOperation; | import io.swagger.annotations.ApiOperation; | ||||
| import org.slf4j.Logger; | |||||
| import org.slf4j.LoggerFactory; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.web.bind.annotation.*; | |||||
| @RestController | @RestController | ||||
| @RequestMapping("wxChannel") | @RequestMapping("wxChannel") | ||||
| public class WxChannelController extends BaseController | |||||
| { | |||||
| @Autowired | |||||
| public class WxChannelController extends BaseController { | |||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||||
| @Autowired | |||||
| private WxChannelService wxChannelService; | private WxChannelService wxChannelService; | ||||
| private Logger logger = Logger.getLogger(WxChannelController.class); | |||||
| @ApiOperation("分页列表接口") | |||||
| @ApiOperation("分页列表接口") | |||||
| @GetMapping("list") | @GetMapping("list") | ||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name="pageNum",value="页数",dataType="int", paramType = "query",required=true), | |||||
| @ApiImplicitParam(name="pageSize",value="每页条数",dataType="int", paramType = "query",required=true)}) | |||||
| public ResultData list(@ModelAttribute WxChannel wxChannel,Integer pageNum, Integer pageSize) { | |||||
| if (null == wxChannel) wxChannel = new WxChannel(); | |||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | |||||
| public ResultData list(@ModelAttribute WxChannel wxChannel, Integer pageNum, Integer pageSize) { | |||||
| if (null == wxChannel) wxChannel = new WxChannel(); | |||||
| final PageInfo<WxChannel> page = wxChannelService.listAsPage(wxChannel, pageNum, pageSize); | final PageInfo<WxChannel> page = wxChannelService.listAsPage(wxChannel, pageNum, pageSize); | ||||
| return new ResultData(page); | return new ResultData(page); | ||||
| } | } | ||||
| @ApiOperation("新增接口") | |||||
| @ApiOperation("新增接口") | |||||
| @PostMapping("add") | @PostMapping("add") | ||||
| public ResultData add(@RequestBody WxChannel wxChannel) { | public ResultData add(@RequestBody WxChannel wxChannel) { | ||||
| //Assert.notNull(wxChannel.getName(), "角色名不能为空"); | //Assert.notNull(wxChannel.getName(), "角色名不能为空"); | ||||
| @@ -53,19 +50,18 @@ public class WxChannelController extends BaseController | |||||
| @ApiOperation("根据id删除接口") | @ApiOperation("根据id删除接口") | ||||
| @GetMapping("/del") | @GetMapping("/del") | ||||
| @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | |||||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | |||||
| public ResultData delete(Long id) { | public ResultData delete(Long id) { | ||||
| wxChannelService.deleteById(id); | wxChannelService.deleteById(id); | ||||
| return new ResultData(Result.SUCCESS, "删除成功", null); | return new ResultData(Result.SUCCESS, "删除成功", null); | ||||
| } | } | ||||
| @ApiOperation("根据id查询接口") | |||||
| @GetMapping("/findById") | |||||
| @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | |||||
| @ApiOperation("根据id查询接口") | |||||
| @GetMapping("/findById") | |||||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | |||||
| public ResultData findById(Long id) { | public ResultData findById(Long id) { | ||||
| return new ResultData(Result.SUCCESS,"查询成功",wxChannelService.getById(id)); | |||||
| return new ResultData(Result.SUCCESS, "查询成功", wxChannelService.getById(id)); | |||||
| } | } | ||||
| } | } | ||||
| @@ -1,41 +1,38 @@ | |||||
| package com.simple.controller; | package com.simple.controller; | ||||
| import org.apache.log4j.Logger; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.util.Assert; | |||||
| import org.springframework.web.bind.annotation.*; | |||||
| import com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| import com.simple.common.Result; | import com.simple.common.Result; | ||||
| import com.simple.common.ResultData; | import com.simple.common.ResultData; | ||||
| import com.simple.domain.po.WxCouponActionLog; | import com.simple.domain.po.WxCouponActionLog; | ||||
| import com.simple.service.WxCouponActionLogService; | import com.simple.service.WxCouponActionLogService; | ||||
| import io.swagger.annotations.ApiImplicitParam; | import io.swagger.annotations.ApiImplicitParam; | ||||
| import io.swagger.annotations.ApiImplicitParams; | import io.swagger.annotations.ApiImplicitParams; | ||||
| import io.swagger.annotations.ApiOperation; | import io.swagger.annotations.ApiOperation; | ||||
| import org.slf4j.Logger; | |||||
| import org.slf4j.LoggerFactory; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.web.bind.annotation.*; | |||||
| @RestController | @RestController | ||||
| @RequestMapping("wxCouponActionLog") | @RequestMapping("wxCouponActionLog") | ||||
| public class WxCouponActionLogController extends BaseController | |||||
| { | |||||
| @Autowired | |||||
| public class WxCouponActionLogController extends BaseController { | |||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||||
| @Autowired | |||||
| private WxCouponActionLogService wxCouponActionLogService; | private WxCouponActionLogService wxCouponActionLogService; | ||||
| private Logger logger = Logger.getLogger(WxCouponActionLogController.class); | |||||
| @ApiOperation("分页列表接口") | |||||
| @ApiOperation("分页列表接口") | |||||
| @GetMapping("list") | @GetMapping("list") | ||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name="pageNum",value="页数",dataType="int", paramType = "query",required=true), | |||||
| @ApiImplicitParam(name="pageSize",value="每页条数",dataType="int", paramType = "query",required=true)}) | |||||
| public ResultData list(@ModelAttribute WxCouponActionLog wxCouponActionLog,Integer pageNum, Integer pageSize) { | |||||
| if (null == wxCouponActionLog) wxCouponActionLog = new WxCouponActionLog(); | |||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | |||||
| public ResultData list(@ModelAttribute WxCouponActionLog wxCouponActionLog, Integer pageNum, Integer pageSize) { | |||||
| if (null == wxCouponActionLog) wxCouponActionLog = new WxCouponActionLog(); | |||||
| final PageInfo<WxCouponActionLog> page = wxCouponActionLogService.listAsPage(wxCouponActionLog, pageNum, pageSize); | final PageInfo<WxCouponActionLog> page = wxCouponActionLogService.listAsPage(wxCouponActionLog, pageNum, pageSize); | ||||
| return new ResultData(page); | return new ResultData(page); | ||||
| } | } | ||||
| @ApiOperation("新增接口") | |||||
| @ApiOperation("新增接口") | |||||
| @PostMapping("add") | @PostMapping("add") | ||||
| public ResultData add(@RequestBody WxCouponActionLog wxCouponActionLog) { | public ResultData add(@RequestBody WxCouponActionLog wxCouponActionLog) { | ||||
| //Assert.notNull(wxCouponActionLog.getName(), "角色名不能为空"); | //Assert.notNull(wxCouponActionLog.getName(), "角色名不能为空"); | ||||
| @@ -53,19 +50,18 @@ public class WxCouponActionLogController extends BaseController | |||||
| @ApiOperation("根据id删除接口") | @ApiOperation("根据id删除接口") | ||||
| @GetMapping("/del") | @GetMapping("/del") | ||||
| @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | |||||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | |||||
| public ResultData delete(Long id) { | public ResultData delete(Long id) { | ||||
| wxCouponActionLogService.deleteById(id); | wxCouponActionLogService.deleteById(id); | ||||
| return new ResultData(Result.SUCCESS, "删除成功", null); | return new ResultData(Result.SUCCESS, "删除成功", null); | ||||
| } | } | ||||
| @ApiOperation("根据id查询接口") | |||||
| @GetMapping("/findById") | |||||
| @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | |||||
| @ApiOperation("根据id查询接口") | |||||
| @GetMapping("/findById") | |||||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | |||||
| public ResultData findById(Long id) { | public ResultData findById(Long id) { | ||||
| return new ResultData(Result.SUCCESS,"查询成功",wxCouponActionLogService.getById(id)); | |||||
| return new ResultData(Result.SUCCESS, "查询成功", wxCouponActionLogService.getById(id)); | |||||
| } | } | ||||
| } | } | ||||
| @@ -1,41 +1,38 @@ | |||||
| package com.simple.controller; | package com.simple.controller; | ||||
| import org.apache.log4j.Logger; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.util.Assert; | |||||
| import org.springframework.web.bind.annotation.*; | |||||
| import com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| import com.simple.common.Result; | import com.simple.common.Result; | ||||
| import com.simple.common.ResultData; | import com.simple.common.ResultData; | ||||
| import com.simple.domain.po.WxCouponCar; | import com.simple.domain.po.WxCouponCar; | ||||
| import com.simple.service.WxCouponCarService; | import com.simple.service.WxCouponCarService; | ||||
| import io.swagger.annotations.ApiImplicitParam; | import io.swagger.annotations.ApiImplicitParam; | ||||
| import io.swagger.annotations.ApiImplicitParams; | import io.swagger.annotations.ApiImplicitParams; | ||||
| import io.swagger.annotations.ApiOperation; | import io.swagger.annotations.ApiOperation; | ||||
| import org.slf4j.Logger; | |||||
| import org.slf4j.LoggerFactory; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.web.bind.annotation.*; | |||||
| @RestController | @RestController | ||||
| @RequestMapping("wxCouponCar") | @RequestMapping("wxCouponCar") | ||||
| public class WxCouponCarController extends BaseController | |||||
| { | |||||
| @Autowired | |||||
| public class WxCouponCarController extends BaseController { | |||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||||
| @Autowired | |||||
| private WxCouponCarService wxCouponCarService; | private WxCouponCarService wxCouponCarService; | ||||
| private Logger logger = Logger.getLogger(WxCouponCarController.class); | |||||
| @ApiOperation("分页列表接口") | |||||
| @ApiOperation("分页列表接口") | |||||
| @GetMapping("list") | @GetMapping("list") | ||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name="pageNum",value="页数",dataType="int", paramType = "query",required=true), | |||||
| @ApiImplicitParam(name="pageSize",value="每页条数",dataType="int", paramType = "query",required=true)}) | |||||
| public ResultData list(@ModelAttribute WxCouponCar wxCouponCar,Integer pageNum, Integer pageSize) { | |||||
| if (null == wxCouponCar) wxCouponCar = new WxCouponCar(); | |||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | |||||
| public ResultData list(@ModelAttribute WxCouponCar wxCouponCar, Integer pageNum, Integer pageSize) { | |||||
| if (null == wxCouponCar) wxCouponCar = new WxCouponCar(); | |||||
| final PageInfo<WxCouponCar> page = wxCouponCarService.listAsPage(wxCouponCar, pageNum, pageSize); | final PageInfo<WxCouponCar> page = wxCouponCarService.listAsPage(wxCouponCar, pageNum, pageSize); | ||||
| return new ResultData(page); | return new ResultData(page); | ||||
| } | } | ||||
| @ApiOperation("新增接口") | |||||
| @ApiOperation("新增接口") | |||||
| @PostMapping("add") | @PostMapping("add") | ||||
| public ResultData add(@RequestBody WxCouponCar wxCouponCar) { | public ResultData add(@RequestBody WxCouponCar wxCouponCar) { | ||||
| //Assert.notNull(wxCouponCar.getName(), "角色名不能为空"); | //Assert.notNull(wxCouponCar.getName(), "角色名不能为空"); | ||||
| @@ -53,19 +50,18 @@ public class WxCouponCarController extends BaseController | |||||
| @ApiOperation("根据id删除接口") | @ApiOperation("根据id删除接口") | ||||
| @GetMapping("/del") | @GetMapping("/del") | ||||
| @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | |||||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | |||||
| public ResultData delete(Long id) { | public ResultData delete(Long id) { | ||||
| wxCouponCarService.deleteById(id); | wxCouponCarService.deleteById(id); | ||||
| return new ResultData(Result.SUCCESS, "删除成功", null); | return new ResultData(Result.SUCCESS, "删除成功", null); | ||||
| } | } | ||||
| @ApiOperation("根据id查询接口") | |||||
| @GetMapping("/findById") | |||||
| @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | |||||
| @ApiOperation("根据id查询接口") | |||||
| @GetMapping("/findById") | |||||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | |||||
| public ResultData findById(Long id) { | public ResultData findById(Long id) { | ||||
| return new ResultData(Result.SUCCESS,"查询成功",wxCouponCarService.getById(id)); | |||||
| return new ResultData(Result.SUCCESS, "查询成功", wxCouponCarService.getById(id)); | |||||
| } | } | ||||
| } | } | ||||
| @@ -1,24 +1,22 @@ | |||||
| package com.simple.controller; | package com.simple.controller; | ||||
| import com.alibaba.fastjson.JSON; | import com.alibaba.fastjson.JSON; | ||||
| import com.simple.domain.dto.WxCouponChannelDto; | |||||
| import com.simple.domain.po.MallUserInfo; | |||||
| import com.simple.domain.po.WxChannel; | |||||
| import com.simple.domain.vo.WxCouponChannelVo; | |||||
| import io.swagger.annotations.Api; | |||||
| import org.apache.log4j.Logger; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.web.bind.annotation.*; | |||||
| import com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| import com.simple.common.Result; | import com.simple.common.Result; | ||||
| import com.simple.common.ResultData; | import com.simple.common.ResultData; | ||||
| import com.simple.domain.dto.WxCouponChannelDto; | |||||
| import com.simple.domain.po.MallUserInfo; | |||||
| import com.simple.domain.po.WxCouponChannel; | import com.simple.domain.po.WxCouponChannel; | ||||
| import com.simple.domain.vo.WxCouponChannelVo; | |||||
| import com.simple.service.WxCouponChannelService; | import com.simple.service.WxCouponChannelService; | ||||
| import io.swagger.annotations.Api; | |||||
| import io.swagger.annotations.ApiImplicitParam; | import io.swagger.annotations.ApiImplicitParam; | ||||
| import io.swagger.annotations.ApiImplicitParams; | import io.swagger.annotations.ApiImplicitParams; | ||||
| import io.swagger.annotations.ApiOperation; | import io.swagger.annotations.ApiOperation; | ||||
| import org.slf4j.Logger; | |||||
| import org.slf4j.LoggerFactory; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.web.bind.annotation.*; | |||||
| import java.util.ArrayList; | import java.util.ArrayList; | ||||
| import java.util.List; | import java.util.List; | ||||
| @@ -26,50 +24,47 @@ import java.util.List; | |||||
| @RestController | @RestController | ||||
| @RequestMapping("wxCouponChannel") | @RequestMapping("wxCouponChannel") | ||||
| @Api(description="优惠券投放接口") | |||||
| public class WxCouponChannelController extends BaseController | |||||
| { | |||||
| @Autowired | |||||
| private WxCouponChannelService wxCouponChannelService; | |||||
| @Api(description = "优惠券投放接口") | |||||
| public class WxCouponChannelController extends BaseController { | |||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||||
| @Autowired | |||||
| private WxCouponChannelService wxCouponChannelService; | |||||
| private Logger logger = Logger.getLogger(WxCouponChannelController.class); | |||||
| @ApiOperation("分页列表接口") | |||||
| @ApiOperation("分页列表接口") | |||||
| @GetMapping("list") | @GetMapping("list") | ||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name="pageNum",value="页数",dataType="int", paramType = "query",required=true), | |||||
| @ApiImplicitParam(name="pageSize",value="每页条数",dataType="int", paramType = "query",required=true)}) | |||||
| public ResultData list(@ModelAttribute WxCouponChannel wxCouponChannel,Integer pageNum, Integer pageSize) { | |||||
| if (null == wxCouponChannel) wxCouponChannel = new WxCouponChannel(); | |||||
| if(wxCouponChannel.getStatus()!=null&&wxCouponChannel.getStatus()==-1){ | |||||
| wxCouponChannel.setStatus(null); | |||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | |||||
| public ResultData list(@ModelAttribute WxCouponChannel wxCouponChannel, Integer pageNum, Integer pageSize) { | |||||
| if (null == wxCouponChannel) wxCouponChannel = new WxCouponChannel(); | |||||
| if (wxCouponChannel.getStatus() != null && wxCouponChannel.getStatus() == -1) { | |||||
| wxCouponChannel.setStatus(null); | |||||
| } | } | ||||
| wxCouponChannel.setTenantId(getUser().getTenantId()); | |||||
| wxCouponChannel.setTenantId(getUser().getTenantId()); | |||||
| wxCouponChannel.setSortColumns(WxCouponChannel.Field.Id_DESC); | wxCouponChannel.setSortColumns(WxCouponChannel.Field.Id_DESC); | ||||
| final PageInfo<WxCouponChannelVo> page = wxCouponChannelService.listPageCAPI(wxCouponChannel, pageNum, pageSize); | final PageInfo<WxCouponChannelVo> page = wxCouponChannelService.listPageCAPI(wxCouponChannel, pageNum, pageSize); | ||||
| return new ResultData(page); | return new ResultData(page); | ||||
| } | } | ||||
| @ApiOperation("根据id更新接口") | @ApiOperation("根据id更新接口") | ||||
| @PostMapping("update") | @PostMapping("update") | ||||
| public ResultData update(@RequestBody WxCouponChannel wxCouponChannel) { | public ResultData update(@RequestBody WxCouponChannel wxCouponChannel) { | ||||
| wxCouponChannel.setTenantId(getUser().getTenantId()); | wxCouponChannel.setTenantId(getUser().getTenantId()); | ||||
| if(wxCouponChannel.getCouponId()!=null&&wxCouponChannel.getStatus()!=null){ | |||||
| if (wxCouponChannel.getCouponId() != null && wxCouponChannel.getStatus() != null) { | |||||
| WxCouponChannel orignal = wxCouponChannelService.getById(wxCouponChannel.getId()); | WxCouponChannel orignal = wxCouponChannelService.getById(wxCouponChannel.getId()); | ||||
| if(orignal.getStatus()==1&&wxCouponChannel.getStatus()==0){ | |||||
| if (orignal.getStatus() == 1 && wxCouponChannel.getStatus() == 0) { | |||||
| //查找是否该券 在该频道有其他上架 | //查找是否该券 在该频道有其他上架 | ||||
| WxCouponChannel query = new WxCouponChannel(); | WxCouponChannel query = new WxCouponChannel(); | ||||
| query.setTenantId(orignal.getTenantId()); | query.setTenantId(orignal.getTenantId()); | ||||
| query.setCouponId(orignal.getCouponId()); | query.setCouponId(orignal.getCouponId()); | ||||
| query.setStatus(0);//已上架 | query.setStatus(0);//已上架 | ||||
| query.setTargetAd(orignal.getTargetAd()); | query.setTargetAd(orignal.getTargetAd()); | ||||
| List<WxCouponChannel> list = wxCouponChannelService.listAsPage(query,1,1).getList(); | |||||
| if(list!=null&&list.size()>0){ | |||||
| List<WxCouponChannel> list = wxCouponChannelService.listAsPage(query, 1, 1).getList(); | |||||
| if (list != null && list.size() > 0) { | |||||
| //不能修改 | //不能修改 | ||||
| return new ResultData(Result.ERROR,"不允许同一个券,多个投放"); | |||||
| return new ResultData(Result.ERROR, "不允许同一个券,多个投放"); | |||||
| } | } | ||||
| } | } | ||||
| @@ -80,17 +75,17 @@ public class WxCouponChannelController extends BaseController | |||||
| @ApiOperation("根据id删除接口") | @ApiOperation("根据id删除接口") | ||||
| @GetMapping("/del") | @GetMapping("/del") | ||||
| @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | |||||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | |||||
| public ResultData delete(Long id) { | public ResultData delete(Long id) { | ||||
| wxCouponChannelService.deleteById(id); | wxCouponChannelService.deleteById(id); | ||||
| return new ResultData(Result.SUCCESS, "删除成功", null); | return new ResultData(Result.SUCCESS, "删除成功", null); | ||||
| } | } | ||||
| @ApiOperation("根据id查询接口") | |||||
| @GetMapping("/findById") | |||||
| @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | |||||
| @ApiOperation("根据id查询接口") | |||||
| @GetMapping("/findById") | |||||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | |||||
| public ResultData findById(Long id) { | public ResultData findById(Long id) { | ||||
| return new ResultData(Result.SUCCESS,"查询成功",wxCouponChannelService.getById(id)); | |||||
| return new ResultData(Result.SUCCESS, "查询成功", wxCouponChannelService.getById(id)); | |||||
| } | } | ||||
| @ApiOperation("批量新增") | @ApiOperation("批量新增") | ||||
| @@ -99,30 +94,27 @@ public class WxCouponChannelController extends BaseController | |||||
| String[] ids = wxCouponChannelDto.getCouponIds().split(","); | String[] ids = wxCouponChannelDto.getCouponIds().split(","); | ||||
| String[] channelId = wxCouponChannelDto.getChannelId().split(","); | String[] channelId = wxCouponChannelDto.getChannelId().split(","); | ||||
| MallUserInfo user = getUser(); | MallUserInfo user = getUser(); | ||||
| return wxCouponChannelService.addBatch(ids,channelId,user.getTenantId(),wxCouponChannelDto.getBeginTime(),wxCouponChannelDto.getEndTime()); | |||||
| return wxCouponChannelService.addBatch(ids, channelId, user.getTenantId(), wxCouponChannelDto.getBeginTime(), wxCouponChannelDto.getEndTime()); | |||||
| } | } | ||||
| @ApiOperation("根据id查询接口") | @ApiOperation("根据id查询接口") | ||||
| @GetMapping("/findChannelByCouponId") | @GetMapping("/findChannelByCouponId") | ||||
| @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | |||||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | |||||
| public ResultData findChannelByCouponId(Long id) { | public ResultData findChannelByCouponId(Long id) { | ||||
| List<Integer> channellist = new ArrayList<>(); | |||||
| List<Integer> channellist = new ArrayList<>(); | |||||
| WxCouponChannel wxCouponChannel = new WxCouponChannel(); | WxCouponChannel wxCouponChannel = new WxCouponChannel(); | ||||
| wxCouponChannel.setTenantId(getTenantId()); | wxCouponChannel.setTenantId(getTenantId()); | ||||
| wxCouponChannel.setStatus(0); | wxCouponChannel.setStatus(0); | ||||
| wxCouponChannel.setCouponId(id); | wxCouponChannel.setCouponId(id); | ||||
| List<WxCouponChannel> list = wxCouponChannelService.listAsPage(wxCouponChannel,1,5).getList(); | |||||
| if(list.isEmpty()){ | |||||
| return new ResultData(Result.SUCCESS,"查询成功", ""); | |||||
| List<WxCouponChannel> list = wxCouponChannelService.listAsPage(wxCouponChannel, 1, 5).getList(); | |||||
| if (list.isEmpty()) { | |||||
| return new ResultData(Result.SUCCESS, "查询成功", ""); | |||||
| } | } | ||||
| for (WxCouponChannel temp:list) { | |||||
| for (WxCouponChannel temp : list) { | |||||
| channellist.add(temp.getTargetAd()); | channellist.add(temp.getTargetAd()); | ||||
| } | } | ||||
| return new ResultData(Result.SUCCESS,"查询成功", JSON.toJSONString(channellist)); | |||||
| return new ResultData(Result.SUCCESS, "查询成功", JSON.toJSONString(channellist)); | |||||
| } | } | ||||
| } | } | ||||
| @@ -1,59 +1,51 @@ | |||||
| package com.simple.controller; | package com.simple.controller; | ||||
| import com.simple.domain.po.WxCouponChannel; | |||||
| import com.simple.service.WxCouponChannelService; | |||||
| import org.apache.commons.lang3.StringUtils; | |||||
| import org.apache.log4j.Logger; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.web.bind.annotation.GetMapping; | |||||
| import org.springframework.web.bind.annotation.ModelAttribute; | |||||
| 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 com.alibaba.fastjson.JSON; | import com.alibaba.fastjson.JSON; | ||||
| import com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| import com.simple.common.Result; | import com.simple.common.Result; | ||||
| import com.simple.common.ResultData; | import com.simple.common.ResultData; | ||||
| import com.simple.domain.dto.WxCounponDto; | import com.simple.domain.dto.WxCounponDto; | ||||
| import com.simple.domain.po.WxCoupon; | import com.simple.domain.po.WxCoupon; | ||||
| import com.simple.domain.po.WxCouponChannel; | |||||
| import com.simple.domain.po.WxMerchant; | import com.simple.domain.po.WxMerchant; | ||||
| import com.simple.service.WxCouponChannelService; | |||||
| import com.simple.service.WxCouponService; | import com.simple.service.WxCouponService; | ||||
| import com.simple.service.WxMerchantService; | import com.simple.service.WxMerchantService; | ||||
| import io.swagger.annotations.Api; | import io.swagger.annotations.Api; | ||||
| import io.swagger.annotations.ApiImplicitParam; | import io.swagger.annotations.ApiImplicitParam; | ||||
| import io.swagger.annotations.ApiImplicitParams; | import io.swagger.annotations.ApiImplicitParams; | ||||
| import io.swagger.annotations.ApiOperation; | import io.swagger.annotations.ApiOperation; | ||||
| import org.apache.commons.lang3.StringUtils; | |||||
| import org.slf4j.Logger; | |||||
| import org.slf4j.LoggerFactory; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.web.bind.annotation.*; | |||||
| import java.util.ArrayList; | import java.util.ArrayList; | ||||
| import java.util.Collections; | |||||
| import java.util.List; | import java.util.List; | ||||
| import java.util.Map; | import java.util.Map; | ||||
| import java.util.stream.Collectors; | import java.util.stream.Collectors; | ||||
| @RestController | @RestController | ||||
| @RequestMapping("wxCoupon") | @RequestMapping("wxCoupon") | ||||
| @Api(description="优惠券接口") | |||||
| public class WxCouponController extends BaseController | |||||
| { | |||||
| @Autowired | |||||
| @Api(description = "优惠券接口") | |||||
| public class WxCouponController extends BaseController { | |||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||||
| @Autowired | |||||
| private WxCouponService wxCouponService; | private WxCouponService wxCouponService; | ||||
| @Autowired | |||||
| private WxMerchantService wxMerchantService; | |||||
| @Autowired | |||||
| @Autowired | |||||
| private WxMerchantService wxMerchantService; | |||||
| @Autowired | |||||
| private WxCouponChannelService wxCouponChannelService; | private WxCouponChannelService wxCouponChannelService; | ||||
| private Logger logger = Logger.getLogger(WxCouponController.class); | |||||
| @ApiOperation("分页列表接口") | |||||
| @ApiOperation("分页列表接口") | |||||
| @GetMapping("list") | @GetMapping("list") | ||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name="pageNum",value="页数",dataType="int", paramType = "query",required=true), | |||||
| @ApiImplicitParam(name="pageSize",value="每页条数",dataType="int", paramType = "query",required=true)}) | |||||
| public ResultData list(@ModelAttribute WxCoupon wxCoupon,Integer pageNum, Integer pageSize) { | |||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | |||||
| public ResultData list(@ModelAttribute WxCoupon wxCoupon, Integer pageNum, Integer pageSize) { | |||||
| if (null == wxCoupon) wxCoupon = new WxCoupon(); | if (null == wxCoupon) wxCoupon = new WxCoupon(); | ||||
| wxCoupon.setTenantId(getTenantId()); | wxCoupon.setTenantId(getTenantId()); | ||||
| wxCoupon.setSortColumns(WxCoupon.Field.Id_DESC); | wxCoupon.setSortColumns(WxCoupon.Field.Id_DESC); | ||||
| @@ -64,37 +56,37 @@ public class WxCouponController extends BaseController | |||||
| List<WxCoupon> wxCouponList = page.getList(); | List<WxCoupon> wxCouponList = page.getList(); | ||||
| if(wxCouponList.isEmpty()){ | |||||
| if (wxCouponList.isEmpty()) { | |||||
| return new ResultData(page); | return new ResultData(page); | ||||
| } | } | ||||
| List<Long> ids = wxCouponList.stream().map(p->p.getId()).collect(Collectors.toList()); | |||||
| List<Long> ids = wxCouponList.stream().map(p -> p.getId()).collect(Collectors.toList()); | |||||
| WxCouponChannel wxCouponChannel = new WxCouponChannel(); | WxCouponChannel wxCouponChannel = new WxCouponChannel(); | ||||
| wxCouponChannel.setTenantId(getTenantId()); | wxCouponChannel.setTenantId(getTenantId()); | ||||
| wxCouponChannel.setCouponIds(ids); | wxCouponChannel.setCouponIds(ids); | ||||
| wxCouponChannel.setStatus(0); | wxCouponChannel.setStatus(0); | ||||
| //上架状态 | //上架状态 | ||||
| List<WxCouponChannel> list = wxCouponChannelService.listAsPage(wxCouponChannel,1,10000).getList(); | |||||
| if(!list.isEmpty()){ | |||||
| List<WxCouponChannel> list = wxCouponChannelService.listAsPage(wxCouponChannel, 1, 10000).getList(); | |||||
| if (!list.isEmpty()) { | |||||
| Map<Long, List<WxCouponChannel>> groupBy = list.stream().collect(Collectors.groupingBy(WxCouponChannel::getCouponId)); | Map<Long, List<WxCouponChannel>> groupBy = list.stream().collect(Collectors.groupingBy(WxCouponChannel::getCouponId)); | ||||
| for (WxCoupon temp:wxCouponList) { | |||||
| for (WxCoupon temp : wxCouponList) { | |||||
| if(groupBy.get(temp.getId())!=null){ | |||||
| List<Integer> channels=new ArrayList<>(); | |||||
| for (WxCouponChannel tempchannel:groupBy.get(temp.getId())) { | |||||
| if(!channels.contains(tempchannel.getTargetAd())) { | |||||
| if (groupBy.get(temp.getId()) != null) { | |||||
| List<Integer> channels = new ArrayList<>(); | |||||
| for (WxCouponChannel tempchannel : groupBy.get(temp.getId())) { | |||||
| if (!channels.contains(tempchannel.getTargetAd())) { | |||||
| channels.add(tempchannel.getTargetAd()); | channels.add(tempchannel.getTargetAd()); | ||||
| } | } | ||||
| } | } | ||||
| String sss = JSON.toJSONString(channels); | String sss = JSON.toJSONString(channels); | ||||
| temp.setChannels(sss); | temp.setChannels(sss); | ||||
| }else{ | |||||
| } else { | |||||
| temp.setChannels(""); | temp.setChannels(""); | ||||
| } | } | ||||
| } | } | ||||
| }else{ | |||||
| for (WxCoupon temp:wxCouponList) { | |||||
| } else { | |||||
| for (WxCoupon temp : wxCouponList) { | |||||
| temp.setChannels(""); | temp.setChannels(""); | ||||
| } | } | ||||
| @@ -103,76 +95,76 @@ public class WxCouponController extends BaseController | |||||
| return new ResultData(page); | return new ResultData(page); | ||||
| } | } | ||||
| @ApiOperation("新增接口") | |||||
| @ApiOperation("新增接口") | |||||
| @PostMapping("add") | @PostMapping("add") | ||||
| public ResultData add(@RequestBody WxCoupon wxCoupon) { | public ResultData add(@RequestBody WxCoupon wxCoupon) { | ||||
| //Assert.notNull(wxCoupon.getName(), "角色名不能为空"); | //Assert.notNull(wxCoupon.getName(), "角色名不能为空"); | ||||
| //Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名"); | //Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名"); | ||||
| if(StringUtils.isNotEmpty(wxCoupon.getSalePriceStr())){ | |||||
| wxCoupon.setSalePrice((int)(Double.parseDouble(wxCoupon.getSalePriceStr())*100)); | |||||
| if (StringUtils.isNotEmpty(wxCoupon.getSalePriceStr())) { | |||||
| wxCoupon.setSalePrice((int) (Double.parseDouble(wxCoupon.getSalePriceStr()) * 100)); | |||||
| } | |||||
| if (StringUtils.isNotEmpty(wxCoupon.getUsePriceStr())) { | |||||
| wxCoupon.setUsePrice((int) (Double.parseDouble(wxCoupon.getUsePriceStr()) * 100)); | |||||
| } | } | ||||
| if(StringUtils.isNotEmpty(wxCoupon.getUsePriceStr())){ | |||||
| wxCoupon.setUsePrice((int)(Double.parseDouble(wxCoupon.getUsePriceStr())*100)); | |||||
| if (StringUtils.isNotEmpty(wxCoupon.getPriceStr())) { | |||||
| wxCoupon.setPrice((int) (Double.parseDouble(wxCoupon.getPriceStr()) * 100)); | |||||
| } | } | ||||
| if(StringUtils.isNotEmpty(wxCoupon.getPriceStr())){ | |||||
| wxCoupon.setPrice((int)(Double.parseDouble(wxCoupon.getPriceStr())*100)); | |||||
| if (StringUtils.isNotBlank(wxCoupon.getBusiness())) { | |||||
| String[] arys = wxCoupon.getBusiness().split(","); | |||||
| wxCoupon.setBusiness(JSON.toJSONString(arys)); | |||||
| } | } | ||||
| if(StringUtils.isNotBlank(wxCoupon.getBusiness())) { | |||||
| String[] arys = wxCoupon.getBusiness().split(","); | |||||
| wxCoupon.setBusiness(JSON.toJSONString(arys)); | |||||
| } | |||||
| wxCoupon.setTenantId(getUser().getTenantId()); | wxCoupon.setTenantId(getUser().getTenantId()); | ||||
| wxCoupon.setChannels(""); | wxCoupon.setChannels(""); | ||||
| Long id = wxCouponService.saveOrUpdate(wxCoupon); | |||||
| Long id = wxCouponService.saveOrUpdate(wxCoupon); | |||||
| return new ResultData(id); | return new ResultData(id); | ||||
| } | } | ||||
| @ApiOperation("根据id更新接口") | @ApiOperation("根据id更新接口") | ||||
| @PostMapping("update") | @PostMapping("update") | ||||
| public ResultData update(@RequestBody WxCoupon wxCoupon) { | public ResultData update(@RequestBody WxCoupon wxCoupon) { | ||||
| if(wxCoupon.getId()==null) { | |||||
| return new ResultData(ResultData.ERROR,"缺少id"); | |||||
| } | |||||
| if(StringUtils.isNotBlank(wxCoupon.getBusiness())) { | |||||
| String[] arys = wxCoupon.getBusiness().split(","); | |||||
| wxCoupon.setBusiness(JSON.toJSONString(arys)); | |||||
| if (wxCoupon.getId() == null) { | |||||
| return new ResultData(ResultData.ERROR, "缺少id"); | |||||
| } | |||||
| if (StringUtils.isNotBlank(wxCoupon.getBusiness())) { | |||||
| String[] arys = wxCoupon.getBusiness().split(","); | |||||
| wxCoupon.setBusiness(JSON.toJSONString(arys)); | |||||
| } | } | ||||
| return wxCouponService.updateCoupon(wxCoupon); | return wxCouponService.updateCoupon(wxCoupon); | ||||
| } | } | ||||
| @ApiOperation("根据id删除接口") | @ApiOperation("根据id删除接口") | ||||
| @GetMapping("/del") | @GetMapping("/del") | ||||
| @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | |||||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | |||||
| public ResultData delete(Long id) { | public ResultData delete(Long id) { | ||||
| wxCouponService.deleteById(id); | wxCouponService.deleteById(id); | ||||
| return new ResultData(Result.SUCCESS, "删除成功", null); | return new ResultData(Result.SUCCESS, "删除成功", null); | ||||
| } | } | ||||
| @ApiOperation("根据id查询接口") | |||||
| @GetMapping("/findById") | |||||
| @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | |||||
| @ApiOperation("根据id查询接口") | |||||
| @GetMapping("/findById") | |||||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | |||||
| public ResultData findById(Long id) { | public ResultData findById(Long id) { | ||||
| WxCoupon c = wxCouponService.getById(id); | |||||
| WxCounponDto dto = new WxCounponDto(); | |||||
| org.springframework.beans.BeanUtils.copyProperties(c, dto); | |||||
| WxMerchant merchant = wxMerchantService.getById(c.getMerchantId()); | |||||
| dto.setWxMerchant(merchant); | |||||
| return new ResultData(Result.SUCCESS,"查询成功",dto); | |||||
| WxCoupon c = wxCouponService.getById(id); | |||||
| WxCounponDto dto = new WxCounponDto(); | |||||
| org.springframework.beans.BeanUtils.copyProperties(c, dto); | |||||
| WxMerchant merchant = wxMerchantService.getById(c.getMerchantId()); | |||||
| dto.setWxMerchant(merchant); | |||||
| return new ResultData(Result.SUCCESS, "查询成功", dto); | |||||
| } | } | ||||
| @ApiOperation("分页列表接口") | @ApiOperation("分页列表接口") | ||||
| @GetMapping("send/list") | @GetMapping("send/list") | ||||
| @ApiImplicitParams({ | @ApiImplicitParams({ | ||||
| @ApiImplicitParam(name="pageNum",value="页数",dataType="int", paramType = "query",required=true), | |||||
| @ApiImplicitParam(name="pageSize",value="每页条数",dataType="int", paramType = "query",required=true)}) | |||||
| public ResultData sendList(@ModelAttribute WxCoupon wxCoupon,Integer pageNum, Integer pageSize) { | |||||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | |||||
| public ResultData sendList(@ModelAttribute WxCoupon wxCoupon, Integer pageNum, Integer pageSize) { | |||||
| if (null == wxCoupon) wxCoupon = new WxCoupon(); | if (null == wxCoupon) wxCoupon = new WxCoupon(); | ||||
| wxCoupon.setTenantId(getTenantId()); | wxCoupon.setTenantId(getTenantId()); | ||||
| wxCoupon.setStatus(0); | wxCoupon.setStatus(0); | ||||
| return new ResultData(wxCouponService.listAsPage(wxCoupon, pageNum, pageSize)); | return new ResultData(wxCouponService.listAsPage(wxCoupon, pageNum, pageSize)); | ||||
| } | } | ||||
| } | } | ||||
| @@ -7,7 +7,8 @@ import io.swagger.annotations.Api; | |||||
| import io.swagger.annotations.ApiImplicitParam; | import io.swagger.annotations.ApiImplicitParam; | ||||
| import io.swagger.annotations.ApiImplicitParams; | import io.swagger.annotations.ApiImplicitParams; | ||||
| import io.swagger.annotations.ApiOperation; | import io.swagger.annotations.ApiOperation; | ||||
| import org.apache.log4j.Logger; | |||||
| import org.slf4j.Logger; | |||||
| import org.slf4j.LoggerFactory; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.web.bind.annotation.GetMapping; | import org.springframework.web.bind.annotation.GetMapping; | ||||
| import org.springframework.web.bind.annotation.ModelAttribute; | import org.springframework.web.bind.annotation.ModelAttribute; | ||||
| @@ -19,33 +20,31 @@ import javax.servlet.http.HttpServletResponse; | |||||
| @RestController | @RestController | ||||
| @RequestMapping("wxCouponOrder") | @RequestMapping("wxCouponOrder") | ||||
| @Api(description="核销和用户卡券查询接口") | |||||
| public class WxCouponOrderController extends BaseController | |||||
| { | |||||
| @Autowired | |||||
| @Api(description = "核销和用户卡券查询接口") | |||||
| public class WxCouponOrderController extends BaseController { | |||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||||
| @Autowired | |||||
| private WxCouponOrderService wxCouponOrderService; | private WxCouponOrderService wxCouponOrderService; | ||||
| private Logger logger = Logger.getLogger(WxCouponOrderController.class); | |||||
| @ApiOperation("分页列表接口") | |||||
| @ApiOperation("分页列表接口") | |||||
| @GetMapping("list") | @GetMapping("list") | ||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name="pageNum",value="页数",dataType="int", paramType = "query",required=true), | |||||
| @ApiImplicitParam(name="pageSize",value="每页条数",dataType="int", paramType = "query",required=true)}) | |||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | |||||
| public ResultData list(@ModelAttribute WxCouponOrder wxCouponOrder, Integer pageNum, Integer pageSize) { | public ResultData list(@ModelAttribute WxCouponOrder wxCouponOrder, Integer pageNum, Integer pageSize) { | ||||
| if (wxCouponOrder == null) wxCouponOrder= new WxCouponOrder(); | |||||
| if (wxCouponOrder == null) wxCouponOrder = new WxCouponOrder(); | |||||
| wxCouponOrder.setTenantId(getTenantId()); | wxCouponOrder.setTenantId(getTenantId()); | ||||
| wxCouponOrder.setSortColumns(WxCouponOrder.Field.Id_DESC); | wxCouponOrder.setSortColumns(WxCouponOrder.Field.Id_DESC); | ||||
| return wxCouponOrderService.listAdminAsPage(wxCouponOrder, pageNum, pageSize); | return wxCouponOrderService.listAdminAsPage(wxCouponOrder, pageNum, pageSize); | ||||
| } | } | ||||
| @RequestMapping("/exportData") | @RequestMapping("/exportData") | ||||
| public void exportData(HttpServletRequest request, HttpServletResponse response){ | |||||
| public void exportData(HttpServletRequest request, HttpServletResponse response) { | |||||
| wxCouponOrderService.exportData(request,response,getTenantId()); | |||||
| wxCouponOrderService.exportData(request, response, getTenantId()); | |||||
| } | } | ||||
| } | } | ||||
| @@ -1,63 +1,59 @@ | |||||
| package com.simple.controller; | package com.simple.controller; | ||||
| import com.simple.domain.po.WxCoupon; | |||||
| import com.simple.service.WxCouponService; | |||||
| import org.apache.log4j.Logger; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.util.Assert; | |||||
| import org.springframework.web.bind.annotation.*; | |||||
| import com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| import com.simple.common.Result; | import com.simple.common.Result; | ||||
| import com.simple.common.ResultData; | import com.simple.common.ResultData; | ||||
| import com.simple.domain.po.WxCoupon; | |||||
| import com.simple.domain.po.WxCouponSend; | import com.simple.domain.po.WxCouponSend; | ||||
| import com.simple.service.WxCouponSendService; | import com.simple.service.WxCouponSendService; | ||||
| import com.simple.service.WxCouponService; | |||||
| import io.swagger.annotations.ApiImplicitParam; | import io.swagger.annotations.ApiImplicitParam; | ||||
| import io.swagger.annotations.ApiImplicitParams; | import io.swagger.annotations.ApiImplicitParams; | ||||
| import io.swagger.annotations.ApiOperation; | import io.swagger.annotations.ApiOperation; | ||||
| import org.slf4j.Logger; | |||||
| import org.slf4j.LoggerFactory; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.web.bind.annotation.*; | |||||
| import java.util.Date; | |||||
| import java.util.List; | import java.util.List; | ||||
| @RestController | @RestController | ||||
| @RequestMapping("wxCouponSend") | @RequestMapping("wxCouponSend") | ||||
| public class WxCouponSendController extends BaseController | |||||
| { | |||||
| @Autowired | |||||
| public class WxCouponSendController extends BaseController { | |||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||||
| @Autowired | |||||
| private WxCouponSendService wxCouponSendService; | private WxCouponSendService wxCouponSendService; | ||||
| @Autowired | |||||
| @Autowired | |||||
| private WxCouponService wxCouponService; | private WxCouponService wxCouponService; | ||||
| private Logger logger = Logger.getLogger(WxCouponSendController.class); | |||||
| @ApiOperation("分页列表接口") | |||||
| @ApiOperation("分页列表接口") | |||||
| @GetMapping("list") | @GetMapping("list") | ||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name="pageNum",value="页数",dataType="int", paramType = "query",required=true), | |||||
| @ApiImplicitParam(name="pageSize",value="每页条数",dataType="int", paramType = "query",required=true)}) | |||||
| public ResultData list(@ModelAttribute WxCouponSend wxCouponSend,Integer pageNum, Integer pageSize) { | |||||
| if (null == wxCouponSend) wxCouponSend = new WxCouponSend(); | |||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | |||||
| public ResultData list(@ModelAttribute WxCouponSend wxCouponSend, Integer pageNum, Integer pageSize) { | |||||
| if (null == wxCouponSend) wxCouponSend = new WxCouponSend(); | |||||
| wxCouponSend.setTenantId(getTenantId()); | wxCouponSend.setTenantId(getTenantId()); | ||||
| final PageInfo<WxCouponSend> page = wxCouponSendService.listAsPage(wxCouponSend, pageNum, pageSize); | final PageInfo<WxCouponSend> page = wxCouponSendService.listAsPage(wxCouponSend, pageNum, pageSize); | ||||
| return new ResultData(page); | return new ResultData(page); | ||||
| } | } | ||||
| @ApiOperation("新增接口") | |||||
| @ApiOperation("新增接口") | |||||
| @PostMapping("add") | @PostMapping("add") | ||||
| public ResultData add(@RequestBody WxCouponSend wxCouponSend) { | public ResultData add(@RequestBody WxCouponSend wxCouponSend) { | ||||
| if (null == wxCouponSend){ | |||||
| return new ResultData(Result.ERROR,"参数不对"); | |||||
| if (null == wxCouponSend) { | |||||
| return new ResultData(Result.ERROR, "参数不对"); | |||||
| } | } | ||||
| wxCouponSend.setTenantId(getTenantId()); | wxCouponSend.setTenantId(getTenantId()); | ||||
| wxCouponSend.setStatus(0); | wxCouponSend.setStatus(0); | ||||
| List<WxCouponSend> wxCouponSendList = wxCouponSendService.listAsPage(wxCouponSend,1,1).getList(); | |||||
| if(wxCouponSendList!=null&&!wxCouponSendList.isEmpty()){ | |||||
| return new ResultData(Result.ERROR,"已经添加过该券"); | |||||
| List<WxCouponSend> wxCouponSendList = wxCouponSendService.listAsPage(wxCouponSend, 1, 1).getList(); | |||||
| if (wxCouponSendList != null && !wxCouponSendList.isEmpty()) { | |||||
| return new ResultData(Result.ERROR, "已经添加过该券"); | |||||
| } | } | ||||
| WxCoupon wxCoupon = wxCouponService.getById(wxCouponSend.getCouponId()); | WxCoupon wxCoupon = wxCouponService.getById(wxCouponSend.getCouponId()); | ||||
| if(wxCoupon.getStatus()!=0||wxCoupon.getSendType()!=2){ | |||||
| return new ResultData(Result.ERROR,"该券的状态有问题"); | |||||
| if (wxCoupon.getStatus() != 0 || wxCoupon.getSendType() != 2) { | |||||
| return new ResultData(Result.ERROR, "该券的状态有问题"); | |||||
| } | } | ||||
| wxCouponSend.setMerchantId(wxCoupon.getMerchantId()); | wxCouponSend.setMerchantId(wxCoupon.getMerchantId()); | ||||
| @@ -74,26 +70,25 @@ public class WxCouponSendController extends BaseController | |||||
| @ApiOperation("根据id更新接口") | @ApiOperation("根据id更新接口") | ||||
| @PostMapping("update") | @PostMapping("update") | ||||
| public ResultData update(@RequestBody WxCouponSend wxCouponSend) { | public ResultData update(@RequestBody WxCouponSend wxCouponSend) { | ||||
| wxCouponSend.setTenantId(getTenantId()); | |||||
| wxCouponSend.setTenantId(getTenantId()); | |||||
| wxCouponSendService.saveOrUpdate(wxCouponSend); | wxCouponSendService.saveOrUpdate(wxCouponSend); | ||||
| return new ResultData(); | return new ResultData(); | ||||
| } | } | ||||
| @ApiOperation("根据id删除接口") | @ApiOperation("根据id删除接口") | ||||
| @GetMapping("/del") | @GetMapping("/del") | ||||
| @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | |||||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | |||||
| public ResultData delete(Long id) { | public ResultData delete(Long id) { | ||||
| wxCouponSendService.deleteById(id); | wxCouponSendService.deleteById(id); | ||||
| return new ResultData(Result.SUCCESS, "删除成功", null); | return new ResultData(Result.SUCCESS, "删除成功", null); | ||||
| } | } | ||||
| @ApiOperation("根据id查询接口") | |||||
| @GetMapping("/findById") | |||||
| @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | |||||
| @ApiOperation("根据id查询接口") | |||||
| @GetMapping("/findById") | |||||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | |||||
| public ResultData findById(Long id) { | public ResultData findById(Long id) { | ||||
| return new ResultData(Result.SUCCESS,"查询成功",wxCouponSendService.getById(id)); | |||||
| return new ResultData(Result.SUCCESS, "查询成功", wxCouponSendService.getById(id)); | |||||
| } | } | ||||
| } | } | ||||
| @@ -1,49 +1,46 @@ | |||||
| package com.simple.controller; | package com.simple.controller; | ||||
| import io.swagger.annotations.Api; | |||||
| import org.apache.log4j.Logger; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.util.Assert; | |||||
| import org.springframework.web.bind.annotation.*; | |||||
| import com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| import com.simple.common.Result; | import com.simple.common.Result; | ||||
| import com.simple.common.ResultData; | import com.simple.common.ResultData; | ||||
| import com.simple.domain.po.WxCouponSpread; | import com.simple.domain.po.WxCouponSpread; | ||||
| import com.simple.service.WxCouponSpreadService; | import com.simple.service.WxCouponSpreadService; | ||||
| import io.swagger.annotations.Api; | |||||
| import io.swagger.annotations.ApiImplicitParam; | import io.swagger.annotations.ApiImplicitParam; | ||||
| import io.swagger.annotations.ApiImplicitParams; | import io.swagger.annotations.ApiImplicitParams; | ||||
| import io.swagger.annotations.ApiOperation; | import io.swagger.annotations.ApiOperation; | ||||
| import org.slf4j.Logger; | |||||
| import org.slf4j.LoggerFactory; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.web.bind.annotation.*; | |||||
| import java.util.List; | import java.util.List; | ||||
| @RestController | @RestController | ||||
| @RequestMapping("wxCouponSpread") | @RequestMapping("wxCouponSpread") | ||||
| @Api(description="推广接口") | |||||
| public class WxCouponSpreadController extends BaseController | |||||
| { | |||||
| @Autowired | |||||
| @Api(description = "推广接口") | |||||
| public class WxCouponSpreadController extends BaseController { | |||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||||
| @Autowired | |||||
| private WxCouponSpreadService wxCouponSpreadService; | private WxCouponSpreadService wxCouponSpreadService; | ||||
| private Logger logger = Logger.getLogger(WxCouponSpreadController.class); | |||||
| @ApiOperation("分页列表接口") | |||||
| @ApiOperation("分页列表接口") | |||||
| @GetMapping("list") | @GetMapping("list") | ||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name="pageNum",value="页数",dataType="int", paramType = "query",required=true), | |||||
| @ApiImplicitParam(name="pageSize",value="每页条数",dataType="int", paramType = "query",required=true)}) | |||||
| public ResultData list(@ModelAttribute WxCouponSpread wxCouponSpread,Integer pageNum, Integer pageSize) { | |||||
| if (null == wxCouponSpread) wxCouponSpread = new WxCouponSpread(); | |||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | |||||
| public ResultData list(@ModelAttribute WxCouponSpread wxCouponSpread, Integer pageNum, Integer pageSize) { | |||||
| if (null == wxCouponSpread) wxCouponSpread = new WxCouponSpread(); | |||||
| final PageInfo<WxCouponSpread> page = wxCouponSpreadService.listAsPage(wxCouponSpread, pageNum, pageSize); | final PageInfo<WxCouponSpread> page = wxCouponSpreadService.listAsPage(wxCouponSpread, pageNum, pageSize); | ||||
| return new ResultData(page); | return new ResultData(page); | ||||
| } | } | ||||
| @ApiOperation("新增接口") | |||||
| @ApiOperation("新增接口") | |||||
| @PostMapping("add") | @PostMapping("add") | ||||
| public ResultData add(@RequestBody WxCouponSpread wxCouponSpread) { | public ResultData add(@RequestBody WxCouponSpread wxCouponSpread) { | ||||
| if(wxCouponSpread.getCouponId()==null){ | |||||
| return new ResultData(Result.ERROR,"没有找到券id"); | |||||
| if (wxCouponSpread.getCouponId() == null) { | |||||
| return new ResultData(Result.ERROR, "没有找到券id"); | |||||
| } | } | ||||
| //Assert.notNull(wxCouponSpread.getName(), "角色名不能为空"); | //Assert.notNull(wxCouponSpread.getName(), "角色名不能为空"); | ||||
| //Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名"); | //Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名"); | ||||
| @@ -60,35 +57,34 @@ public class WxCouponSpreadController extends BaseController | |||||
| @ApiOperation("根据id删除接口") | @ApiOperation("根据id删除接口") | ||||
| @GetMapping("/del") | @GetMapping("/del") | ||||
| @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | |||||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | |||||
| public ResultData delete(Long id) { | public ResultData delete(Long id) { | ||||
| wxCouponSpreadService.deleteById(id); | wxCouponSpreadService.deleteById(id); | ||||
| return new ResultData(Result.SUCCESS, "删除成功", null); | return new ResultData(Result.SUCCESS, "删除成功", null); | ||||
| } | } | ||||
| @ApiOperation("根据id查询接口") | |||||
| @GetMapping("/findById") | |||||
| @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | |||||
| @ApiOperation("根据id查询接口") | |||||
| @GetMapping("/findById") | |||||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | |||||
| public ResultData findById(Long id) { | public ResultData findById(Long id) { | ||||
| return new ResultData(Result.SUCCESS,"查询成功",wxCouponSpreadService.getById(id)); | |||||
| return new ResultData(Result.SUCCESS, "查询成功", wxCouponSpreadService.getById(id)); | |||||
| } | } | ||||
| @ApiOperation("根据卡券id查询接口") | @ApiOperation("根据卡券id查询接口") | ||||
| @GetMapping("/findByCouponId") | @GetMapping("/findByCouponId") | ||||
| @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | |||||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | |||||
| public ResultData findByCouponId(Long id) { | public ResultData findByCouponId(Long id) { | ||||
| WxCouponSpread result = null; | WxCouponSpread result = null; | ||||
| if(id!=null){ | |||||
| WxCouponSpread wxCouponSpread = new WxCouponSpread(); | |||||
| if (id != null) { | |||||
| WxCouponSpread wxCouponSpread = new WxCouponSpread(); | |||||
| wxCouponSpread.setCouponId(id); | wxCouponSpread.setCouponId(id); | ||||
| List<WxCouponSpread> list = wxCouponSpreadService.findList(wxCouponSpread); | List<WxCouponSpread> list = wxCouponSpreadService.findList(wxCouponSpread); | ||||
| if(!list.isEmpty()){ | |||||
| if (!list.isEmpty()) { | |||||
| result = list.get(0); | result = list.get(0); | ||||
| } | } | ||||
| } | } | ||||
| return new ResultData(Result.SUCCESS,"查询成功",result); | |||||
| return new ResultData(Result.SUCCESS, "查询成功", result); | |||||
| } | } | ||||
| } | } | ||||
| @@ -1,44 +1,40 @@ | |||||
| package com.simple.controller; | package com.simple.controller; | ||||
| import org.apache.log4j.Logger; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.util.Assert; | |||||
| import org.springframework.web.bind.annotation.*; | |||||
| import com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| import com.simple.common.Result; | import com.simple.common.Result; | ||||
| import com.simple.common.ResultData; | import com.simple.common.ResultData; | ||||
| import com.simple.domain.po.WxCouponType; | import com.simple.domain.po.WxCouponType; | ||||
| import com.simple.service.WxCouponTypeService; | import com.simple.service.WxCouponTypeService; | ||||
| import io.swagger.annotations.Api; | import io.swagger.annotations.Api; | ||||
| import io.swagger.annotations.ApiImplicitParam; | import io.swagger.annotations.ApiImplicitParam; | ||||
| import io.swagger.annotations.ApiImplicitParams; | import io.swagger.annotations.ApiImplicitParams; | ||||
| import io.swagger.annotations.ApiOperation; | import io.swagger.annotations.ApiOperation; | ||||
| import org.slf4j.Logger; | |||||
| import org.slf4j.LoggerFactory; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.web.bind.annotation.*; | |||||
| @RestController | @RestController | ||||
| @RequestMapping("wxCouponType") | @RequestMapping("wxCouponType") | ||||
| @Api(description="优惠券类型相关接口") | |||||
| public class WxCouponTypeController extends BaseController | |||||
| { | |||||
| @Autowired | |||||
| @Api(description = "优惠券类型相关接口") | |||||
| public class WxCouponTypeController extends BaseController { | |||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||||
| @Autowired | |||||
| private WxCouponTypeService wxCouponTypeService; | private WxCouponTypeService wxCouponTypeService; | ||||
| private Logger logger = Logger.getLogger(WxCouponTypeController.class); | |||||
| @ApiOperation("分页列表接口") | |||||
| @ApiOperation("分页列表接口") | |||||
| @GetMapping("list") | @GetMapping("list") | ||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name="pageNum",value="页数",dataType="int", paramType = "query",required=true), | |||||
| @ApiImplicitParam(name="pageSize",value="每页条数",dataType="int", paramType = "query",required=true)}) | |||||
| public ResultData list(@ModelAttribute WxCouponType wxCouponType,Integer pageNum, Integer pageSize) { | |||||
| if (null == wxCouponType) wxCouponType = new WxCouponType(); | |||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | |||||
| public ResultData list(@ModelAttribute WxCouponType wxCouponType, Integer pageNum, Integer pageSize) { | |||||
| if (null == wxCouponType) wxCouponType = new WxCouponType(); | |||||
| final PageInfo<WxCouponType> page = wxCouponTypeService.listAsPage(wxCouponType, pageNum, pageSize); | final PageInfo<WxCouponType> page = wxCouponTypeService.listAsPage(wxCouponType, pageNum, pageSize); | ||||
| return new ResultData(page); | return new ResultData(page); | ||||
| } | } | ||||
| @ApiOperation("新增接口") | |||||
| @ApiOperation("新增接口") | |||||
| @PostMapping("add") | @PostMapping("add") | ||||
| public ResultData add(@RequestBody WxCouponType wxCouponType) { | public ResultData add(@RequestBody WxCouponType wxCouponType) { | ||||
| //Assert.notNull(wxCouponType.getName(), "角色名不能为空"); | //Assert.notNull(wxCouponType.getName(), "角色名不能为空"); | ||||
| @@ -56,19 +52,18 @@ public class WxCouponTypeController extends BaseController | |||||
| @ApiOperation("根据id删除接口") | @ApiOperation("根据id删除接口") | ||||
| @GetMapping("/del") | @GetMapping("/del") | ||||
| @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | |||||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | |||||
| public ResultData delete(Long id) { | public ResultData delete(Long id) { | ||||
| wxCouponTypeService.deleteById(id); | wxCouponTypeService.deleteById(id); | ||||
| return new ResultData(Result.SUCCESS, "删除成功", null); | return new ResultData(Result.SUCCESS, "删除成功", null); | ||||
| } | } | ||||
| @ApiOperation("根据id查询接口") | |||||
| @GetMapping("/findById") | |||||
| @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | |||||
| @ApiOperation("根据id查询接口") | |||||
| @GetMapping("/findById") | |||||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | |||||
| public ResultData findById(Long id) { | public ResultData findById(Long id) { | ||||
| return new ResultData(Result.SUCCESS,"查询成功",wxCouponTypeService.getById(id)); | |||||
| return new ResultData(Result.SUCCESS, "查询成功", wxCouponTypeService.getById(id)); | |||||
| } | } | ||||
| } | } | ||||
| @@ -7,25 +7,25 @@ import com.simple.domain.po.WxGroup; | |||||
| import com.simple.service.WxGroupService; | import com.simple.service.WxGroupService; | ||||
| import io.swagger.annotations.ApiImplicitParam; | import io.swagger.annotations.ApiImplicitParam; | ||||
| import io.swagger.annotations.ApiImplicitParams; | import io.swagger.annotations.ApiImplicitParams; | ||||
| import org.apache.log4j.Logger; | |||||
| import org.slf4j.Logger; | |||||
| import org.slf4j.LoggerFactory; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.web.bind.annotation.*; | import org.springframework.web.bind.annotation.*; | ||||
| @RestController | @RestController | ||||
| @RequestMapping("wxGroup") | @RequestMapping("wxGroup") | ||||
| public class WxGroupController extends BaseController | |||||
| { | |||||
| @Autowired | |||||
| private WxGroupService wxGroupService; | |||||
| public class WxGroupController extends BaseController { | |||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||||
| private Logger logger = Logger.getLogger(WxGroupController.class); | |||||
| @Autowired | |||||
| private WxGroupService wxGroupService; | |||||
| @GetMapping("list") | @GetMapping("list") | ||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name="pageNum",value="页数",dataType="int", paramType = "query",required=true), | |||||
| @ApiImplicitParam(name="pageSize",value="每页条数",dataType="int", paramType = "query",required=true)}) | |||||
| public ResultData list(@ModelAttribute WxGroup wxGroup,Integer pageNum, Integer pageSize) { | |||||
| if (null == wxGroup) wxGroup = new WxGroup(); | |||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | |||||
| public ResultData list(@ModelAttribute WxGroup wxGroup, Integer pageNum, Integer pageSize) { | |||||
| if (null == wxGroup) wxGroup = new WxGroup(); | |||||
| final PageInfo<WxGroup> page = wxGroupService.listAsPage(wxGroup, pageNum, pageSize); | final PageInfo<WxGroup> page = wxGroupService.listAsPage(wxGroup, pageNum, pageSize); | ||||
| return new ResultData(page); | return new ResultData(page); | ||||
| } | } | ||||
| @@ -45,18 +45,17 @@ public class WxGroupController extends BaseController | |||||
| } | } | ||||
| @GetMapping("/del") | @GetMapping("/del") | ||||
| @ApiImplicitParam(name="id",value="id",dataType="String", paramType = "query",required=true) | |||||
| @ApiImplicitParam(name = "id", value = "id", dataType = "String", paramType = "query", required = true) | |||||
| public ResultData delete(String id) { | public ResultData delete(String id) { | ||||
| wxGroupService.deleteById(id); | wxGroupService.deleteById(id); | ||||
| return new ResultData(Result.SUCCESS, "删除成功", null); | return new ResultData(Result.SUCCESS, "删除成功", null); | ||||
| } | } | ||||
| @GetMapping("/findById") | |||||
| @ApiImplicitParam(name="id",value="id",dataType="String", paramType = "query",required=true) | |||||
| @GetMapping("/findById") | |||||
| @ApiImplicitParam(name = "id", value = "id", dataType = "String", paramType = "query", required = true) | |||||
| public ResultData findById(String id) { | public ResultData findById(String id) { | ||||
| return new ResultData(Result.SUCCESS,"查询成功",wxGroupService.getById(id)); | |||||
| return new ResultData(Result.SUCCESS, "查询成功", wxGroupService.getById(id)); | |||||
| } | } | ||||
| } | } | ||||
| @@ -1,6 +1,7 @@ | |||||
| package com.simple.controller; | package com.simple.controller; | ||||
| import org.apache.log4j.Logger; | |||||
| import org.slf4j.Logger; | |||||
| import org.slf4j.LoggerFactory; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.web.bind.annotation.GetMapping; | import org.springframework.web.bind.annotation.GetMapping; | ||||
| import org.springframework.web.bind.annotation.ModelAttribute; | import org.springframework.web.bind.annotation.ModelAttribute; | ||||
| @@ -24,12 +25,11 @@ import io.swagger.annotations.ApiOperation; | |||||
| @RestController | @RestController | ||||
| @RequestMapping("wxLevelConfig") | @RequestMapping("wxLevelConfig") | ||||
| @Api(description="等级权益相关接口") | @Api(description="等级权益相关接口") | ||||
| public class WxLevelConfigController extends BaseController | |||||
| { | |||||
| public class WxLevelConfigController extends BaseController { | |||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||||
| @Autowired | @Autowired | ||||
| private WxLevelConfigService wxLevelConfigService; | private WxLevelConfigService wxLevelConfigService; | ||||
| private Logger logger = Logger.getLogger(WxLevelConfigController.class); | |||||
| @ApiOperation("分页列表接口") | @ApiOperation("分页列表接口") | ||||
| @GetMapping("list") | @GetMapping("list") | ||||
| @@ -8,25 +8,25 @@ import com.simple.domain.po.WxMsgValidationcode; | |||||
| import com.simple.service.WxMallApplyService; | import com.simple.service.WxMallApplyService; | ||||
| import io.swagger.annotations.ApiImplicitParam; | import io.swagger.annotations.ApiImplicitParam; | ||||
| import io.swagger.annotations.ApiImplicitParams; | import io.swagger.annotations.ApiImplicitParams; | ||||
| import org.apache.log4j.Logger; | |||||
| import org.slf4j.Logger; | |||||
| import org.slf4j.LoggerFactory; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.web.bind.annotation.*; | import org.springframework.web.bind.annotation.*; | ||||
| @RestController | @RestController | ||||
| @RequestMapping("wxMallApply") | @RequestMapping("wxMallApply") | ||||
| public class WxMallApplyController extends BaseController | |||||
| { | |||||
| @Autowired | |||||
| private WxMallApplyService wxMallApplyService; | |||||
| public class WxMallApplyController extends BaseController { | |||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||||
| private Logger logger = Logger.getLogger(WxMallApplyController.class); | |||||
| @Autowired | |||||
| private WxMallApplyService wxMallApplyService; | |||||
| @GetMapping("list") | @GetMapping("list") | ||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name="pageNum",value="页数",dataType="int", paramType = "query",required=true), | |||||
| @ApiImplicitParam(name="pageSize",value="每页条数",dataType="int", paramType = "query",required=true)}) | |||||
| public ResultData list(@ModelAttribute WxMallApply wxMallApply,Integer pageNum, Integer pageSize) { | |||||
| if (null == wxMallApply) wxMallApply = new WxMallApply(); | |||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | |||||
| public ResultData list(@ModelAttribute WxMallApply wxMallApply, Integer pageNum, Integer pageSize) { | |||||
| if (null == wxMallApply) wxMallApply = new WxMallApply(); | |||||
| final PageInfo<WxMallApply> page = wxMallApplyService.listAsPage(wxMallApply, pageNum, pageSize); | final PageInfo<WxMallApply> page = wxMallApplyService.listAsPage(wxMallApply, pageNum, pageSize); | ||||
| return new ResultData(page); | return new ResultData(page); | ||||
| } | } | ||||
| @@ -46,16 +46,16 @@ public class WxMallApplyController extends BaseController | |||||
| } | } | ||||
| @GetMapping("/del") | @GetMapping("/del") | ||||
| @ApiImplicitParam(name="id",value="id",dataType="String", paramType = "query",required=true) | |||||
| @ApiImplicitParam(name = "id", value = "id", dataType = "String", paramType = "query", required = true) | |||||
| public ResultData delete(String id) { | public ResultData delete(String id) { | ||||
| wxMallApplyService.deleteById(id); | wxMallApplyService.deleteById(id); | ||||
| return new ResultData(Result.SUCCESS, "删除成功", null); | return new ResultData(Result.SUCCESS, "删除成功", null); | ||||
| } | } | ||||
| @GetMapping("/findById") | |||||
| @ApiImplicitParam(name="id",value="id",dataType="String", paramType = "query",required=true) | |||||
| @GetMapping("/findById") | |||||
| @ApiImplicitParam(name = "id", value = "id", dataType = "String", paramType = "query", required = true) | |||||
| public ResultData findById(String id) { | public ResultData findById(String id) { | ||||
| return new ResultData(Result.SUCCESS,"查询成功",wxMallApplyService.getById(id)); | |||||
| return new ResultData(Result.SUCCESS, "查询成功", wxMallApplyService.getById(id)); | |||||
| } | } | ||||
| @@ -70,6 +70,6 @@ public class WxMallApplyController extends BaseController | |||||
| wxMsgValidationcode.setType(type); | wxMsgValidationcode.setType(type); | ||||
| return wxMallApplyService.sendvalidationcode(wxMsgValidationcode); | return wxMallApplyService.sendvalidationcode(wxMsgValidationcode); | ||||
| } | } | ||||
| } | } | ||||
| @@ -8,18 +8,18 @@ import com.simple.service.WxMallBuildingService; | |||||
| import io.swagger.annotations.ApiImplicitParam; | import io.swagger.annotations.ApiImplicitParam; | ||||
| import io.swagger.annotations.ApiImplicitParams; | import io.swagger.annotations.ApiImplicitParams; | ||||
| import io.swagger.annotations.ApiOperation; | import io.swagger.annotations.ApiOperation; | ||||
| import org.apache.log4j.Logger; | |||||
| import org.slf4j.Logger; | |||||
| import org.slf4j.LoggerFactory; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.web.bind.annotation.*; | import org.springframework.web.bind.annotation.*; | ||||
| @RestController | @RestController | ||||
| @RequestMapping("wxMallBuilding") | @RequestMapping("wxMallBuilding") | ||||
| public class WxMallBuildingController extends BaseController | |||||
| { | |||||
| public class WxMallBuildingController extends BaseController { | |||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||||
| @Autowired | @Autowired | ||||
| private WxMallBuildingService wxMallBuildingService; | private WxMallBuildingService wxMallBuildingService; | ||||
| private Logger logger = Logger.getLogger(WxMallBuildingController.class); | |||||
| @ApiOperation("分页列表接口") | @ApiOperation("分页列表接口") | ||||
| @GetMapping("list") | @GetMapping("list") | ||||
| @@ -1,81 +1,75 @@ | |||||
| package com.simple.controller; | package com.simple.controller; | ||||
| import org.apache.log4j.Logger; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.web.bind.annotation.GetMapping; | |||||
| 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 com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| import com.simple.common.ResultData; | import com.simple.common.ResultData; | ||||
| import com.simple.domain.po.WxMallConfig; | import com.simple.domain.po.WxMallConfig; | ||||
| import com.simple.service.WxMallConfigService; | import com.simple.service.WxMallConfigService; | ||||
| import io.swagger.annotations.Api; | import io.swagger.annotations.Api; | ||||
| import io.swagger.annotations.ApiOperation; | import io.swagger.annotations.ApiOperation; | ||||
| import org.slf4j.Logger; | |||||
| import org.slf4j.LoggerFactory; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.web.bind.annotation.*; | |||||
| @RestController | @RestController | ||||
| @RequestMapping("wxMallConfig") | @RequestMapping("wxMallConfig") | ||||
| @Api(description="停车发券和核销发劵接口") | |||||
| public class WxMallConfigController extends BaseController | |||||
| { | |||||
| @Autowired | |||||
| @Api(description = "停车发券和核销发劵接口") | |||||
| public class WxMallConfigController extends BaseController { | |||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||||
| @Autowired | |||||
| private WxMallConfigService wxMallConfigService; | private WxMallConfigService wxMallConfigService; | ||||
| private Logger logger = Logger.getLogger(WxMallConfigController.class); | |||||
| @ApiOperation("获取停车劵开关") | @ApiOperation("获取停车劵开关") | ||||
| @GetMapping("getStopCarConpon") | @GetMapping("getStopCarConpon") | ||||
| public ResultData getStopCarConpon() { | public ResultData getStopCarConpon() { | ||||
| WxMallConfig wxMallConfig = new WxMallConfig(); | |||||
| wxMallConfig.setKey("stopCarCouponSwitch"); | |||||
| wxMallConfig.setTenantId(getTenantId()); | |||||
| PageInfo<WxMallConfig> page = wxMallConfigService.listAsPage(wxMallConfig, 1, 1); | |||||
| if(page.getSize()>0) { | |||||
| WxMallConfig config = page.getList().get(0); | |||||
| return new ResultData(config); | |||||
| } | |||||
| return new ResultData(); | |||||
| WxMallConfig wxMallConfig = new WxMallConfig(); | |||||
| wxMallConfig.setKey("stopCarCouponSwitch"); | |||||
| wxMallConfig.setTenantId(getTenantId()); | |||||
| PageInfo<WxMallConfig> page = wxMallConfigService.listAsPage(wxMallConfig, 1, 1); | |||||
| if (page.getSize() > 0) { | |||||
| WxMallConfig config = page.getList().get(0); | |||||
| return new ResultData(config); | |||||
| } | |||||
| return new ResultData(); | |||||
| } | } | ||||
| @ApiOperation("获取核销劵开关") | @ApiOperation("获取核销劵开关") | ||||
| @GetMapping("getVerifyConpon") | @GetMapping("getVerifyConpon") | ||||
| public ResultData getVerifyConpon() { | public ResultData getVerifyConpon() { | ||||
| WxMallConfig wxMallConfig = new WxMallConfig(); | |||||
| wxMallConfig.setKey("verifyConponSwitch"); | |||||
| wxMallConfig.setTenantId(getTenantId()); | |||||
| PageInfo<WxMallConfig> page = wxMallConfigService.listAsPage(wxMallConfig, 1, 1); | |||||
| if(page.getSize()>0) { | |||||
| WxMallConfig config = page.getList().get(0); | |||||
| return new ResultData(config); | |||||
| } | |||||
| return new ResultData(); | |||||
| WxMallConfig wxMallConfig = new WxMallConfig(); | |||||
| wxMallConfig.setKey("verifyConponSwitch"); | |||||
| wxMallConfig.setTenantId(getTenantId()); | |||||
| PageInfo<WxMallConfig> page = wxMallConfigService.listAsPage(wxMallConfig, 1, 1); | |||||
| if (page.getSize() > 0) { | |||||
| WxMallConfig config = page.getList().get(0); | |||||
| return new ResultData(config); | |||||
| } | |||||
| return new ResultData(); | |||||
| } | } | ||||
| @PostMapping("updateStopCarConpon") | @PostMapping("updateStopCarConpon") | ||||
| @ApiOperation("修改停车开关") | @ApiOperation("修改停车开关") | ||||
| public ResultData updateStopCarConpon(@RequestBody WxMallConfig wxMallConfig) { | public ResultData updateStopCarConpon(@RequestBody WxMallConfig wxMallConfig) { | ||||
| WxMallConfig temp = new WxMallConfig(); | |||||
| WxMallConfig temp = new WxMallConfig(); | |||||
| // temp.setKey("stopCarCouponSwitch"); | // temp.setKey("stopCarCouponSwitch"); | ||||
| temp.setValue(wxMallConfig.getValue()); | |||||
| temp.setId(wxMallConfig.getId()); | |||||
| wxMallConfigService.saveOrUpdate(temp); | |||||
| return new ResultData(); | |||||
| temp.setValue(wxMallConfig.getValue()); | |||||
| temp.setId(wxMallConfig.getId()); | |||||
| wxMallConfigService.saveOrUpdate(temp); | |||||
| return new ResultData(); | |||||
| } | } | ||||
| @PostMapping("updateVerifyConpon") | @PostMapping("updateVerifyConpon") | ||||
| @ApiOperation("修改核销开关") | @ApiOperation("修改核销开关") | ||||
| public ResultData updateVerifyConpon(@RequestBody WxMallConfig wxMallConfig) { | public ResultData updateVerifyConpon(@RequestBody WxMallConfig wxMallConfig) { | ||||
| WxMallConfig temp = new WxMallConfig(); | |||||
| WxMallConfig temp = new WxMallConfig(); | |||||
| // temp.setKey("verifyConponSwitch"); | // temp.setKey("verifyConponSwitch"); | ||||
| temp.setValue(wxMallConfig.getValue()); | |||||
| temp.setId(wxMallConfig.getId()); | |||||
| wxMallConfigService.saveOrUpdate(temp); | |||||
| return new ResultData(); | |||||
| temp.setValue(wxMallConfig.getValue()); | |||||
| temp.setId(wxMallConfig.getId()); | |||||
| wxMallConfigService.saveOrUpdate(temp); | |||||
| return new ResultData(); | |||||
| } | } | ||||
| // @ApiOperation("分页列表接口") | // @ApiOperation("分页列表接口") | ||||
| // @GetMapping("list") | // @GetMapping("list") | ||||
| // @ApiImplicitParams({ | // @ApiImplicitParams({ | ||||
| @@ -117,7 +111,6 @@ public class WxMallConfigController extends BaseController | |||||
| // public ResultData findById(Long id) { | // public ResultData findById(Long id) { | ||||
| // return new ResultData(Result.SUCCESS,"查询成功",wxMallConfigService.getById(id)); | // return new ResultData(Result.SUCCESS,"查询成功",wxMallConfigService.getById(id)); | ||||
| // } | // } | ||||
| } | } | ||||
| @@ -1,6 +1,7 @@ | |||||
| package com.simple.controller; | package com.simple.controller; | ||||
| import org.apache.log4j.Logger; | |||||
| import org.slf4j.Logger; | |||||
| import org.slf4j.LoggerFactory; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.util.Assert; | import org.springframework.util.Assert; | ||||
| import org.springframework.web.bind.annotation.*; | import org.springframework.web.bind.annotation.*; | ||||
| @@ -17,12 +18,11 @@ import io.swagger.annotations.ApiOperation; | |||||
| @RestController | @RestController | ||||
| @RequestMapping("wxMall") | @RequestMapping("wxMall") | ||||
| public class WxMallController extends BaseController | |||||
| { | |||||
| public class WxMallController extends BaseController { | |||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||||
| @Autowired | @Autowired | ||||
| private WxMallService wxMallService; | private WxMallService wxMallService; | ||||
| private Logger logger = Logger.getLogger(WxMallController.class); | |||||
| @ApiOperation("分页列表接口") | @ApiOperation("分页列表接口") | ||||
| @GetMapping("list") | @GetMapping("list") | ||||
| @@ -1,6 +1,7 @@ | |||||
| package com.simple.controller; | package com.simple.controller; | ||||
| import org.apache.log4j.Logger; | |||||
| import org.slf4j.Logger; | |||||
| import org.slf4j.LoggerFactory; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.util.Assert; | import org.springframework.util.Assert; | ||||
| import org.springframework.web.bind.annotation.*; | import org.springframework.web.bind.annotation.*; | ||||
| @@ -17,12 +18,11 @@ import io.swagger.annotations.ApiOperation; | |||||
| @RestController | @RestController | ||||
| @RequestMapping("wxMallFloor") | @RequestMapping("wxMallFloor") | ||||
| public class WxMallFloorController extends BaseController | |||||
| { | |||||
| public class WxMallFloorController extends BaseController { | |||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||||
| @Autowired | @Autowired | ||||
| private WxMallFloorService wxMallFloorService; | private WxMallFloorService wxMallFloorService; | ||||
| private Logger logger = Logger.getLogger(WxMallFloorController.class); | |||||
| @ApiOperation("分页列表接口") | @ApiOperation("分页列表接口") | ||||
| @GetMapping("list") | @GetMapping("list") | ||||
| @@ -10,7 +10,8 @@ import io.swagger.annotations.ApiImplicitParam; | |||||
| import io.swagger.annotations.ApiImplicitParams; | import io.swagger.annotations.ApiImplicitParams; | ||||
| import io.swagger.annotations.ApiOperation; | import io.swagger.annotations.ApiOperation; | ||||
| import org.apache.commons.lang3.StringUtils; | import org.apache.commons.lang3.StringUtils; | ||||
| import org.apache.log4j.Logger; | |||||
| import org.slf4j.Logger; | |||||
| import org.slf4j.LoggerFactory; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.web.bind.annotation.*; | import org.springframework.web.bind.annotation.*; | ||||
| @@ -18,12 +19,11 @@ import java.util.Map; | |||||
| @RestController | @RestController | ||||
| @RequestMapping("wxMerchantBUser") | @RequestMapping("wxMerchantBUser") | ||||
| public class WxMerchantBUserController extends BaseController | |||||
| { | |||||
| public class WxMerchantBUserController extends BaseController { | |||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||||
| @Autowired | @Autowired | ||||
| private WxMerchantBUserService wxMerchantBUserService; | private WxMerchantBUserService wxMerchantBUserService; | ||||
| private Logger logger = Logger.getLogger(WxMerchantBUserController.class); | |||||
| @ApiOperation("分页列表接口") | @ApiOperation("分页列表接口") | ||||
| @GetMapping("list") | @GetMapping("list") | ||||
| @@ -8,7 +8,8 @@ import com.simple.service.WxMerchantService; | |||||
| import io.swagger.annotations.ApiImplicitParam; | import io.swagger.annotations.ApiImplicitParam; | ||||
| import io.swagger.annotations.ApiImplicitParams; | import io.swagger.annotations.ApiImplicitParams; | ||||
| import io.swagger.annotations.ApiOperation; | import io.swagger.annotations.ApiOperation; | ||||
| import org.apache.log4j.Logger; | |||||
| import org.slf4j.Logger; | |||||
| import org.slf4j.LoggerFactory; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.web.bind.annotation.*; | import org.springframework.web.bind.annotation.*; | ||||
| @@ -17,11 +18,11 @@ import java.util.List; | |||||
| @RestController | @RestController | ||||
| @RequestMapping("wxMerchant") | @RequestMapping("wxMerchant") | ||||
| public class WxMerchantController extends BaseController { | public class WxMerchantController extends BaseController { | ||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||||
| @Autowired | @Autowired | ||||
| private WxMerchantService wxMerchantService; | private WxMerchantService wxMerchantService; | ||||
| private Logger logger = Logger.getLogger(WxMerchantController.class); | |||||
| @ApiOperation("分页列表接口") | @ApiOperation("分页列表接口") | ||||
| @GetMapping("list") | @GetMapping("list") | ||||
| @ApiImplicitParams({ | @ApiImplicitParams({ | ||||
| @@ -9,26 +9,26 @@ import com.simple.service.WxMerchantShopService; | |||||
| import io.swagger.annotations.ApiImplicitParam; | import io.swagger.annotations.ApiImplicitParam; | ||||
| import io.swagger.annotations.ApiImplicitParams; | import io.swagger.annotations.ApiImplicitParams; | ||||
| import io.swagger.annotations.ApiOperation; | import io.swagger.annotations.ApiOperation; | ||||
| import org.apache.log4j.Logger; | |||||
| import org.slf4j.Logger; | |||||
| import org.slf4j.LoggerFactory; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.web.bind.annotation.*; | import org.springframework.web.bind.annotation.*; | ||||
| @RestController | @RestController | ||||
| @RequestMapping("wxMerchantShop") | @RequestMapping("wxMerchantShop") | ||||
| public class WxMerchantShopController extends BaseController | |||||
| { | |||||
| @Autowired | |||||
| public class WxMerchantShopController extends BaseController { | |||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||||
| @Autowired | |||||
| private WxMerchantShopService wxMerchantShopService; | private WxMerchantShopService wxMerchantShopService; | ||||
| private Logger logger = Logger.getLogger(WxMerchantShopController.class); | |||||
| @ApiOperation("分页列表接口") | |||||
| @ApiOperation("分页列表接口") | |||||
| @GetMapping("list") | @GetMapping("list") | ||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name="pageNum",value="页数",dataType="int", paramType = "query",required=true), | |||||
| @ApiImplicitParam(name="pageSize",value="每页条数",dataType="int", paramType = "query",required=true)}) | |||||
| public ResultData list(@ModelAttribute WxMerchantShop wxMerchantShop,Integer pageNum, Integer pageSize) { | |||||
| if (null == wxMerchantShop) wxMerchantShop = new WxMerchantShop(); | |||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | |||||
| public ResultData list(@ModelAttribute WxMerchantShop wxMerchantShop, Integer pageNum, Integer pageSize) { | |||||
| if (null == wxMerchantShop) wxMerchantShop = new WxMerchantShop(); | |||||
| final PageInfo<WxMerchantShop> page = wxMerchantShopService.listAsPage(wxMerchantShop, pageNum, pageSize); | final PageInfo<WxMerchantShop> page = wxMerchantShopService.listAsPage(wxMerchantShop, pageNum, pageSize); | ||||
| return new ResultData(page); | return new ResultData(page); | ||||
| } | } | ||||
| @@ -36,16 +36,16 @@ public class WxMerchantShopController extends BaseController | |||||
| @ApiOperation("获取关联商铺信息") | @ApiOperation("获取关联商铺信息") | ||||
| @GetMapping("queryShopList") | @GetMapping("queryShopList") | ||||
| @ApiImplicitParams({ | @ApiImplicitParams({ | ||||
| @ApiImplicitParam(name="pageNum",value="页数",dataType="int", paramType = "query",required=true), | |||||
| @ApiImplicitParam(name="pageSize",value="每页条数",dataType="int", paramType = "query",required=true)}) | |||||
| public ResultData queryShopList(@ModelAttribute WxMerchantShop wxMerchantShop,Integer pageNum, Integer pageSize) { | |||||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | |||||
| public ResultData queryShopList(@ModelAttribute WxMerchantShop wxMerchantShop, Integer pageNum, Integer pageSize) { | |||||
| if (null == wxMerchantShop) wxMerchantShop = new WxMerchantShop(); | if (null == wxMerchantShop) wxMerchantShop = new WxMerchantShop(); | ||||
| final PageInfo<WxShop> page = wxMerchantShopService.queryShopList(wxMerchantShop, pageNum, pageSize); | final PageInfo<WxShop> page = wxMerchantShopService.queryShopList(wxMerchantShop, pageNum, pageSize); | ||||
| return new ResultData(page); | return new ResultData(page); | ||||
| } | } | ||||
| @ApiOperation("新增接口") | |||||
| @ApiOperation("新增接口") | |||||
| @PostMapping("add") | @PostMapping("add") | ||||
| public ResultData add(@RequestBody WxMerchantShop wxMerchantShop) { | public ResultData add(@RequestBody WxMerchantShop wxMerchantShop) { | ||||
| //Assert.notNull(wxMerchantShop.getName(), "角色名不能为空"); | //Assert.notNull(wxMerchantShop.getName(), "角色名不能为空"); | ||||
| @@ -63,19 +63,18 @@ public class WxMerchantShopController extends BaseController | |||||
| @ApiOperation("根据id删除接口") | @ApiOperation("根据id删除接口") | ||||
| @GetMapping("/del") | @GetMapping("/del") | ||||
| @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | |||||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | |||||
| public ResultData delete(Long id) { | public ResultData delete(Long id) { | ||||
| wxMerchantShopService.deleteById(id); | wxMerchantShopService.deleteById(id); | ||||
| return new ResultData(Result.SUCCESS, "删除成功", null); | return new ResultData(Result.SUCCESS, "删除成功", null); | ||||
| } | } | ||||
| @ApiOperation("根据id查询接口") | |||||
| @GetMapping("/findById") | |||||
| @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | |||||
| @ApiOperation("根据id查询接口") | |||||
| @GetMapping("/findById") | |||||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | |||||
| public ResultData findById(Long id) { | public ResultData findById(Long id) { | ||||
| return new ResultData(Result.SUCCESS,"查询成功",wxMerchantShopService.getById(id)); | |||||
| return new ResultData(Result.SUCCESS, "查询成功", wxMerchantShopService.getById(id)); | |||||
| } | } | ||||
| } | } | ||||
| @@ -1,41 +1,38 @@ | |||||
| package com.simple.controller; | package com.simple.controller; | ||||
| import org.apache.log4j.Logger; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.util.Assert; | |||||
| import org.springframework.web.bind.annotation.*; | |||||
| import com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| import com.simple.common.Result; | import com.simple.common.Result; | ||||
| import com.simple.common.ResultData; | import com.simple.common.ResultData; | ||||
| import com.simple.domain.po.WxMerchantTradeDaily; | import com.simple.domain.po.WxMerchantTradeDaily; | ||||
| import com.simple.service.WxMerchantTradeDailyService; | import com.simple.service.WxMerchantTradeDailyService; | ||||
| import io.swagger.annotations.ApiImplicitParam; | import io.swagger.annotations.ApiImplicitParam; | ||||
| import io.swagger.annotations.ApiImplicitParams; | import io.swagger.annotations.ApiImplicitParams; | ||||
| import io.swagger.annotations.ApiOperation; | import io.swagger.annotations.ApiOperation; | ||||
| import org.slf4j.Logger; | |||||
| import org.slf4j.LoggerFactory; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.web.bind.annotation.*; | |||||
| @RestController | @RestController | ||||
| @RequestMapping("wxMerchantTradeDaily") | @RequestMapping("wxMerchantTradeDaily") | ||||
| public class WxMerchantTradeDailyController extends BaseController | |||||
| { | |||||
| @Autowired | |||||
| public class WxMerchantTradeDailyController extends BaseController { | |||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||||
| @Autowired | |||||
| private WxMerchantTradeDailyService wxMerchantTradeDailyService; | private WxMerchantTradeDailyService wxMerchantTradeDailyService; | ||||
| private Logger logger = Logger.getLogger(WxMerchantTradeDailyController.class); | |||||
| @ApiOperation("分页列表接口") | |||||
| @ApiOperation("分页列表接口") | |||||
| @GetMapping("list") | @GetMapping("list") | ||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name="pageNum",value="页数",dataType="int", paramType = "query",required=true), | |||||
| @ApiImplicitParam(name="pageSize",value="每页条数",dataType="int", paramType = "query",required=true)}) | |||||
| public ResultData list(@ModelAttribute WxMerchantTradeDaily wxMerchantTradeDaily,Integer pageNum, Integer pageSize) { | |||||
| if (null == wxMerchantTradeDaily) wxMerchantTradeDaily = new WxMerchantTradeDaily(); | |||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | |||||
| public ResultData list(@ModelAttribute WxMerchantTradeDaily wxMerchantTradeDaily, Integer pageNum, Integer pageSize) { | |||||
| if (null == wxMerchantTradeDaily) wxMerchantTradeDaily = new WxMerchantTradeDaily(); | |||||
| final PageInfo<WxMerchantTradeDaily> page = wxMerchantTradeDailyService.listAsPage(wxMerchantTradeDaily, pageNum, pageSize); | final PageInfo<WxMerchantTradeDaily> page = wxMerchantTradeDailyService.listAsPage(wxMerchantTradeDaily, pageNum, pageSize); | ||||
| return new ResultData(page); | return new ResultData(page); | ||||
| } | } | ||||
| @ApiOperation("新增接口") | |||||
| @ApiOperation("新增接口") | |||||
| @PostMapping("add") | @PostMapping("add") | ||||
| public ResultData add(@RequestBody WxMerchantTradeDaily wxMerchantTradeDaily) { | public ResultData add(@RequestBody WxMerchantTradeDaily wxMerchantTradeDaily) { | ||||
| //Assert.notNull(wxMerchantTradeDaily.getName(), "角色名不能为空"); | //Assert.notNull(wxMerchantTradeDaily.getName(), "角色名不能为空"); | ||||
| @@ -53,19 +50,18 @@ public class WxMerchantTradeDailyController extends BaseController | |||||
| @ApiOperation("根据id删除接口") | @ApiOperation("根据id删除接口") | ||||
| @GetMapping("/del") | @GetMapping("/del") | ||||
| @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | |||||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | |||||
| public ResultData delete(Long id) { | public ResultData delete(Long id) { | ||||
| wxMerchantTradeDailyService.deleteById(id); | wxMerchantTradeDailyService.deleteById(id); | ||||
| return new ResultData(Result.SUCCESS, "删除成功", null); | return new ResultData(Result.SUCCESS, "删除成功", null); | ||||
| } | } | ||||
| @ApiOperation("根据id查询接口") | |||||
| @GetMapping("/findById") | |||||
| @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | |||||
| @ApiOperation("根据id查询接口") | |||||
| @GetMapping("/findById") | |||||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | |||||
| public ResultData findById(Long id) { | public ResultData findById(Long id) { | ||||
| return new ResultData(Result.SUCCESS,"查询成功",wxMerchantTradeDailyService.getById(id)); | |||||
| return new ResultData(Result.SUCCESS, "查询成功", wxMerchantTradeDailyService.getById(id)); | |||||
| } | } | ||||
| } | } | ||||
| @@ -8,7 +8,8 @@ import com.simple.service.WxMsgCallbackService; | |||||
| import io.swagger.annotations.ApiImplicitParam; | import io.swagger.annotations.ApiImplicitParam; | ||||
| import io.swagger.annotations.ApiImplicitParams; | import io.swagger.annotations.ApiImplicitParams; | ||||
| import io.swagger.annotations.ApiOperation; | import io.swagger.annotations.ApiOperation; | ||||
| import org.apache.log4j.Logger; | |||||
| import org.slf4j.Logger; | |||||
| import org.slf4j.LoggerFactory; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.web.bind.annotation.*; | import org.springframework.web.bind.annotation.*; | ||||
| @@ -16,26 +17,25 @@ import java.util.Map; | |||||
| @RestController | @RestController | ||||
| @RequestMapping("wxMsgCallback") | @RequestMapping("wxMsgCallback") | ||||
| public class WxMsgCallbackController extends BaseController | |||||
| { | |||||
| @Autowired | |||||
| public class WxMsgCallbackController extends BaseController { | |||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||||
| @Autowired | |||||
| private WxMsgCallbackService wxMsgCallbackService; | private WxMsgCallbackService wxMsgCallbackService; | ||||
| private Logger logger = Logger.getLogger(WxMsgCallbackController.class); | |||||
| @ApiOperation("分页列表接口") | |||||
| @ApiOperation("分页列表接口") | |||||
| @GetMapping("list") | @GetMapping("list") | ||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name="pageNum",value="页数",dataType="int", paramType = "query",required=true), | |||||
| @ApiImplicitParam(name="pageSize",value="每页条数",dataType="int", paramType = "query",required=true)}) | |||||
| public ResultData list(@ModelAttribute WxMsgCallback wxMsgCallback,Integer pageNum, Integer pageSize) { | |||||
| if (null == wxMsgCallback) wxMsgCallback = new WxMsgCallback(); | |||||
| wxMsgCallback.setTenantId(getTenantId()); | |||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | |||||
| public ResultData list(@ModelAttribute WxMsgCallback wxMsgCallback, Integer pageNum, Integer pageSize) { | |||||
| if (null == wxMsgCallback) wxMsgCallback = new WxMsgCallback(); | |||||
| wxMsgCallback.setTenantId(getTenantId()); | |||||
| final PageInfo<WxMsgCallback> page = wxMsgCallbackService.listAsPage(wxMsgCallback, pageNum, pageSize); | final PageInfo<WxMsgCallback> page = wxMsgCallbackService.listAsPage(wxMsgCallback, pageNum, pageSize); | ||||
| return new ResultData(page); | return new ResultData(page); | ||||
| } | } | ||||
| @ApiOperation("新增接口") | |||||
| @ApiOperation("新增接口") | |||||
| @PostMapping("add") | @PostMapping("add") | ||||
| public ResultData add(@RequestBody WxMsgCallback wxMsgCallback) { | public ResultData add(@RequestBody WxMsgCallback wxMsgCallback) { | ||||
| //Assert.notNull(wxMsgCallback.getName(), "角色名不能为空"); | //Assert.notNull(wxMsgCallback.getName(), "角色名不能为空"); | ||||
| @@ -54,41 +54,41 @@ public class WxMsgCallbackController extends BaseController | |||||
| @ApiOperation("根据id删除接口") | @ApiOperation("根据id删除接口") | ||||
| @GetMapping("/del") | @GetMapping("/del") | ||||
| @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | |||||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | |||||
| public ResultData delete(Long id) { | public ResultData delete(Long id) { | ||||
| wxMsgCallbackService.deleteById(id); | wxMsgCallbackService.deleteById(id); | ||||
| return new ResultData(Result.SUCCESS, "删除成功", null); | return new ResultData(Result.SUCCESS, "删除成功", null); | ||||
| } | } | ||||
| @ApiOperation("根据id查询接口") | |||||
| @GetMapping("/findById") | |||||
| @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | |||||
| @ApiOperation("根据id查询接口") | |||||
| @GetMapping("/findById") | |||||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | |||||
| public ResultData findById(Long id) { | public ResultData findById(Long id) { | ||||
| return new ResultData(Result.SUCCESS,"查询成功",wxMsgCallbackService.getById(id)); | |||||
| return new ResultData(Result.SUCCESS, "查询成功", wxMsgCallbackService.getById(id)); | |||||
| } | } | ||||
| @RequestMapping(value = "/receivemsg/{bid}") | @RequestMapping(value = "/receivemsg/{bid}") | ||||
| public void receivemsg(@PathVariable String bid, @RequestParam Map<String,String> param) { | |||||
| public void receivemsg(@PathVariable String bid, @RequestParam Map<String, String> param) { | |||||
| //解析param数据插入数据库中 | //解析param数据插入数据库中 | ||||
| String item = param.get("item"); | String item = param.get("item"); | ||||
| String sign = param.get("sign"); | String sign = param.get("sign"); | ||||
| String tenantId=getTenantId(); | |||||
| wxMsgCallbackService.saveOrUpdate(tenantId,bid,item,sign); | |||||
| String tenantId = getTenantId(); | |||||
| wxMsgCallbackService.saveOrUpdate(tenantId, bid, item, sign); | |||||
| } | } | ||||
| @RequestMapping(value = "/receivemodel/{bid}") | @RequestMapping(value = "/receivemodel/{bid}") | ||||
| public void receivemodel(@PathVariable String bid, @RequestParam Map<String,String> param) { | |||||
| public void receivemodel(@PathVariable String bid, @RequestParam Map<String, String> param) { | |||||
| //解析param数据插入数据库中 | //解析param数据插入数据库中 | ||||
| wxMsgCallbackService.receivemodel(getTenantId(),bid,param); | |||||
| wxMsgCallbackService.receivemodel(getTenantId(), bid, param); | |||||
| } | } | ||||
| @RequestMapping(value = "/receiveverifymodel/{bid}") | @RequestMapping(value = "/receiveverifymodel/{bid}") | ||||
| public void receiveverifymodel(@PathVariable String bid, @RequestParam Map<String,String> param) { | |||||
| public void receiveverifymodel(@PathVariable String bid, @RequestParam Map<String, String> param) { | |||||
| //解析param数据插入数据库中 | //解析param数据插入数据库中 | ||||
| wxMsgCallbackService.receiveverifymodel(bid,param); | |||||
| wxMsgCallbackService.receiveverifymodel(bid, param); | |||||
| } | } | ||||
| @@ -1,41 +1,38 @@ | |||||
| package com.simple.controller; | package com.simple.controller; | ||||
| import org.apache.log4j.Logger; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.util.Assert; | |||||
| import org.springframework.web.bind.annotation.*; | |||||
| import com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| import com.simple.common.Result; | import com.simple.common.Result; | ||||
| import com.simple.common.ResultData; | import com.simple.common.ResultData; | ||||
| import com.simple.domain.po.WxMsgConfig; | import com.simple.domain.po.WxMsgConfig; | ||||
| import com.simple.service.WxMsgConfigService; | import com.simple.service.WxMsgConfigService; | ||||
| import io.swagger.annotations.ApiImplicitParam; | import io.swagger.annotations.ApiImplicitParam; | ||||
| import io.swagger.annotations.ApiImplicitParams; | import io.swagger.annotations.ApiImplicitParams; | ||||
| import io.swagger.annotations.ApiOperation; | import io.swagger.annotations.ApiOperation; | ||||
| import org.slf4j.Logger; | |||||
| import org.slf4j.LoggerFactory; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.web.bind.annotation.*; | |||||
| @RestController | @RestController | ||||
| @RequestMapping("wxMsgConfig") | @RequestMapping("wxMsgConfig") | ||||
| public class WxMsgConfigController extends BaseController | |||||
| { | |||||
| @Autowired | |||||
| public class WxMsgConfigController extends BaseController { | |||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||||
| @Autowired | |||||
| private WxMsgConfigService wxMsgConfigService; | private WxMsgConfigService wxMsgConfigService; | ||||
| private Logger logger = Logger.getLogger(WxMsgConfigController.class); | |||||
| @ApiOperation("分页列表接口") | |||||
| @ApiOperation("分页列表接口") | |||||
| @GetMapping("list") | @GetMapping("list") | ||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name="pageNum",value="页数",dataType="int", paramType = "query",required=true), | |||||
| @ApiImplicitParam(name="pageSize",value="每页条数",dataType="int", paramType = "query",required=true)}) | |||||
| public ResultData list(@ModelAttribute WxMsgConfig wxMsgConfig,Integer pageNum, Integer pageSize) { | |||||
| if (null == wxMsgConfig) wxMsgConfig = new WxMsgConfig(); | |||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | |||||
| public ResultData list(@ModelAttribute WxMsgConfig wxMsgConfig, Integer pageNum, Integer pageSize) { | |||||
| if (null == wxMsgConfig) wxMsgConfig = new WxMsgConfig(); | |||||
| final PageInfo<WxMsgConfig> page = wxMsgConfigService.listAsPage(wxMsgConfig, pageNum, pageSize); | final PageInfo<WxMsgConfig> page = wxMsgConfigService.listAsPage(wxMsgConfig, pageNum, pageSize); | ||||
| return new ResultData(page); | return new ResultData(page); | ||||
| } | } | ||||
| @ApiOperation("新增接口") | |||||
| @ApiOperation("新增接口") | |||||
| @PostMapping("add") | @PostMapping("add") | ||||
| public ResultData add(@RequestBody WxMsgConfig wxMsgConfig) { | public ResultData add(@RequestBody WxMsgConfig wxMsgConfig) { | ||||
| //Assert.notNull(wxMsgConfig.getName(), "角色名不能为空"); | //Assert.notNull(wxMsgConfig.getName(), "角色名不能为空"); | ||||
| @@ -53,19 +50,18 @@ public class WxMsgConfigController extends BaseController | |||||
| @ApiOperation("根据id删除接口") | @ApiOperation("根据id删除接口") | ||||
| @GetMapping("/del") | @GetMapping("/del") | ||||
| @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | |||||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | |||||
| public ResultData delete(Long id) { | public ResultData delete(Long id) { | ||||
| wxMsgConfigService.deleteById(id); | wxMsgConfigService.deleteById(id); | ||||
| return new ResultData(Result.SUCCESS, "删除成功", null); | return new ResultData(Result.SUCCESS, "删除成功", null); | ||||
| } | } | ||||
| @ApiOperation("根据id查询接口") | |||||
| @GetMapping("/findById") | |||||
| @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | |||||
| @ApiOperation("根据id查询接口") | |||||
| @GetMapping("/findById") | |||||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | |||||
| public ResultData findById(Long id) { | public ResultData findById(Long id) { | ||||
| return new ResultData(Result.SUCCESS,"查询成功",wxMsgConfigService.getById(id)); | |||||
| return new ResultData(Result.SUCCESS, "查询成功", wxMsgConfigService.getById(id)); | |||||
| } | } | ||||
| } | } | ||||
| @@ -10,7 +10,8 @@ import io.swagger.annotations.ApiImplicitParam; | |||||
| import io.swagger.annotations.ApiImplicitParams; | import io.swagger.annotations.ApiImplicitParams; | ||||
| import io.swagger.annotations.ApiOperation; | import io.swagger.annotations.ApiOperation; | ||||
| import org.apache.commons.io.IOUtils; | import org.apache.commons.io.IOUtils; | ||||
| import org.apache.log4j.Logger; | |||||
| import org.slf4j.Logger; | |||||
| import org.slf4j.LoggerFactory; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.web.bind.annotation.*; | import org.springframework.web.bind.annotation.*; | ||||
| import org.springframework.web.multipart.MultipartFile; | import org.springframework.web.multipart.MultipartFile; | ||||
| @@ -21,26 +22,25 @@ import java.util.UUID; | |||||
| @RestController | @RestController | ||||
| @RequestMapping("wxMsg") | @RequestMapping("wxMsg") | ||||
| public class WxMsgController extends BaseController | |||||
| { | |||||
| @Autowired | |||||
| public class WxMsgController extends BaseController { | |||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||||
| @Autowired | |||||
| private WxMsgService wxMsgService; | private WxMsgService wxMsgService; | ||||
| private Logger logger = Logger.getLogger(WxMsgController.class); | |||||
| @ApiOperation("分页列表接口") | |||||
| @ApiOperation("分页列表接口") | |||||
| @GetMapping("list") | @GetMapping("list") | ||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name="pageNum",value="页数",dataType="int", paramType = "query",required=true), | |||||
| @ApiImplicitParam(name="pageSize",value="每页条数",dataType="int", paramType = "query",required=true)}) | |||||
| public ResultData list(@ModelAttribute WxMsg wxMsg,Integer pageNum, Integer pageSize) { | |||||
| if (null == wxMsg) wxMsg = new WxMsg(); | |||||
| wxMsg.setTenantId(getTenantId()); | |||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | |||||
| public ResultData list(@ModelAttribute WxMsg wxMsg, Integer pageNum, Integer pageSize) { | |||||
| if (null == wxMsg) wxMsg = new WxMsg(); | |||||
| wxMsg.setTenantId(getTenantId()); | |||||
| final PageInfo<WxMsg> page = wxMsgService.listAsPage(wxMsg, pageNum, pageSize); | final PageInfo<WxMsg> page = wxMsgService.listAsPage(wxMsg, pageNum, pageSize); | ||||
| return new ResultData(page); | return new ResultData(page); | ||||
| } | } | ||||
| @ApiOperation("新增接口") | |||||
| @ApiOperation("新增接口") | |||||
| @PostMapping("add") | @PostMapping("add") | ||||
| public ResultData add(@RequestBody WxMsg wxMsg) { | public ResultData add(@RequestBody WxMsg wxMsg) { | ||||
| //Assert.notNull(wxMsg.getName(), "角色名不能为空"); | //Assert.notNull(wxMsg.getName(), "角色名不能为空"); | ||||
| @@ -59,41 +59,41 @@ public class WxMsgController extends BaseController | |||||
| @ApiOperation("根据id删除接口") | @ApiOperation("根据id删除接口") | ||||
| @GetMapping("/del") | @GetMapping("/del") | ||||
| @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | |||||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | |||||
| public ResultData delete(Long id) { | public ResultData delete(Long id) { | ||||
| wxMsgService.deleteById(id); | wxMsgService.deleteById(id); | ||||
| return new ResultData(Result.SUCCESS, "删除成功", null); | return new ResultData(Result.SUCCESS, "删除成功", null); | ||||
| } | } | ||||
| @ApiOperation("根据id查询接口") | |||||
| @GetMapping("/findById") | |||||
| @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | |||||
| @ApiOperation("根据id查询接口") | |||||
| @GetMapping("/findById") | |||||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | |||||
| public ResultData findById(Long id) { | public ResultData findById(Long id) { | ||||
| return new ResultData(Result.SUCCESS,"查询成功",wxMsgService.getById(id)); | |||||
| return new ResultData(Result.SUCCESS, "查询成功", wxMsgService.getById(id)); | |||||
| } | } | ||||
| @RequestMapping("/excleupload") | @RequestMapping("/excleupload") | ||||
| public ResultData excleupload(@RequestParam("file") MultipartFile file) { | public ResultData excleupload(@RequestParam("file") MultipartFile file) { | ||||
| if (file.isEmpty()) { | if (file.isEmpty()) { | ||||
| return new ResultData(Result.SUCCESS,"上传文件不能为空"); | |||||
| return new ResultData(Result.SUCCESS, "上传文件不能为空"); | |||||
| } | } | ||||
| String filename= UUID.randomUUID()+file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")); | |||||
| File path=new File(Constant.fileDirectory); | |||||
| if(!path.exists()){ | |||||
| String filename = UUID.randomUUID() + file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")); | |||||
| File path = new File(Constant.fileDirectory); | |||||
| if (!path.exists()) { | |||||
| path.mkdirs(); | path.mkdirs(); | ||||
| } | } | ||||
| String filepath= Constant.fileDirectory+File.separator+filename; | |||||
| String filepath = Constant.fileDirectory + File.separator + filename; | |||||
| try { | try { | ||||
| FileOutputStream out=new FileOutputStream(new File(filepath)); | |||||
| FileOutputStream out = new FileOutputStream(new File(filepath)); | |||||
| IOUtils.write(file.getBytes(), out); | IOUtils.write(file.getBytes(), out); | ||||
| IOUtils.closeQuietly(out); | IOUtils.closeQuietly(out); | ||||
| } catch (Exception e) { | } catch (Exception e) { | ||||
| return new ResultData(Result.ERROR,"上传失败"); | |||||
| return new ResultData(Result.ERROR, "上传失败"); | |||||
| } | } | ||||
| return new ResultData(Result.SUCCESS,"上传成功",filepath); | |||||
| return new ResultData(Result.SUCCESS, "上传成功", filepath); | |||||
| } | } | ||||
| } | } | ||||
| @@ -8,39 +8,39 @@ import com.simple.service.WxMsgModelService; | |||||
| import io.swagger.annotations.ApiImplicitParam; | import io.swagger.annotations.ApiImplicitParam; | ||||
| import io.swagger.annotations.ApiImplicitParams; | import io.swagger.annotations.ApiImplicitParams; | ||||
| import io.swagger.annotations.ApiOperation; | import io.swagger.annotations.ApiOperation; | ||||
| import org.apache.log4j.Logger; | |||||
| import org.slf4j.Logger; | |||||
| import org.slf4j.LoggerFactory; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.web.bind.annotation.*; | import org.springframework.web.bind.annotation.*; | ||||
| @RestController | @RestController | ||||
| @RequestMapping("wxMsgModel") | @RequestMapping("wxMsgModel") | ||||
| public class WxMsgModelController extends BaseController | |||||
| { | |||||
| @Autowired | |||||
| public class WxMsgModelController extends BaseController { | |||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||||
| @Autowired | |||||
| private WxMsgModelService wxMsgModelService; | private WxMsgModelService wxMsgModelService; | ||||
| private Logger logger = Logger.getLogger(WxMsgModelController.class); | |||||
| @ApiOperation("分页列表接口") | |||||
| @ApiOperation("分页列表接口") | |||||
| @GetMapping("list") | @GetMapping("list") | ||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name="pageNum",value="页数",dataType="int", paramType = "query",required=true), | |||||
| @ApiImplicitParam(name="pageSize",value="每页条数",dataType="int", paramType = "query",required=true)}) | |||||
| public ResultData list(@ModelAttribute WxMsgModel wxMsgModel,Integer pageNum, Integer pageSize) { | |||||
| if (null == wxMsgModel) wxMsgModel = new WxMsgModel(); | |||||
| wxMsgModel.setTenantId(getTenantId()); | |||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | |||||
| public ResultData list(@ModelAttribute WxMsgModel wxMsgModel, Integer pageNum, Integer pageSize) { | |||||
| if (null == wxMsgModel) wxMsgModel = new WxMsgModel(); | |||||
| wxMsgModel.setTenantId(getTenantId()); | |||||
| final PageInfo<WxMsgModel> page = wxMsgModelService.listAsPage(wxMsgModel, pageNum, pageSize); | final PageInfo<WxMsgModel> page = wxMsgModelService.listAsPage(wxMsgModel, pageNum, pageSize); | ||||
| return new ResultData(page); | return new ResultData(page); | ||||
| } | } | ||||
| @ApiOperation("新增接口") | |||||
| @ApiOperation("新增接口") | |||||
| @PostMapping("add") | @PostMapping("add") | ||||
| public ResultData add(@RequestBody WxMsgModel wxMsgModel) { | public ResultData add(@RequestBody WxMsgModel wxMsgModel) { | ||||
| //Assert.notNull(wxMsgModel.getName(), "角色名不能为空"); | //Assert.notNull(wxMsgModel.getName(), "角色名不能为空"); | ||||
| //Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名"); | //Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名"); | ||||
| wxMsgModel.setTenantId(getTenantId()); | wxMsgModel.setTenantId(getTenantId()); | ||||
| return wxMsgModelService.saveOrUpdate(wxMsgModel); | return wxMsgModelService.saveOrUpdate(wxMsgModel); | ||||
| } | } | ||||
| @ApiOperation("根据id更新接口") | @ApiOperation("根据id更新接口") | ||||
| @@ -51,25 +51,24 @@ public class WxMsgModelController extends BaseController | |||||
| @ApiOperation("根据id删除接口") | @ApiOperation("根据id删除接口") | ||||
| @GetMapping("/del") | @GetMapping("/del") | ||||
| @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | |||||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | |||||
| public ResultData delete(Long id) { | public ResultData delete(Long id) { | ||||
| wxMsgModelService.deleteById(id); | wxMsgModelService.deleteById(id); | ||||
| return new ResultData(Result.SUCCESS, "删除成功", null); | return new ResultData(Result.SUCCESS, "删除成功", null); | ||||
| } | } | ||||
| @ApiOperation("根据id查询接口") | |||||
| @GetMapping("/findById") | |||||
| @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | |||||
| @ApiOperation("根据id查询接口") | |||||
| @GetMapping("/findById") | |||||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | |||||
| public ResultData findById(Long id) { | public ResultData findById(Long id) { | ||||
| return new ResultData(Result.SUCCESS,"查询成功",wxMsgModelService.getById(id)); | |||||
| return new ResultData(Result.SUCCESS, "查询成功", wxMsgModelService.getById(id)); | |||||
| } | } | ||||
| @ApiOperation("获取所有数据") | @ApiOperation("获取所有数据") | ||||
| @GetMapping("getmodellist") | @GetMapping("getmodellist") | ||||
| public ResultData getmodellist() { | public ResultData getmodellist() { | ||||
| return wxMsgModelService.getmodellist(getTenantId()); | |||||
| return wxMsgModelService.getmodellist(getTenantId()); | |||||
| } | } | ||||
| } | } | ||||
| @@ -14,26 +14,25 @@ import org.springframework.web.bind.annotation.*; | |||||
| @RestController | @RestController | ||||
| @RequestMapping("wxMsgSignature") | @RequestMapping("wxMsgSignature") | ||||
| public class WxMsgSignatureController extends BaseController | |||||
| { | |||||
| @Autowired | |||||
| public class WxMsgSignatureController extends BaseController { | |||||
| @Autowired | |||||
| private WxMsgSignatureService wxMsgSignatureService; | private WxMsgSignatureService wxMsgSignatureService; | ||||
| private Logger logger = Logger.getLogger(WxMsgSignatureController.class); | private Logger logger = Logger.getLogger(WxMsgSignatureController.class); | ||||
| @ApiOperation("分页列表接口") | |||||
| @ApiOperation("分页列表接口") | |||||
| @GetMapping("list") | @GetMapping("list") | ||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name="pageNum",value="页数",dataType="int", paramType = "query",required=true), | |||||
| @ApiImplicitParam(name="pageSize",value="每页条数",dataType="int", paramType = "query",required=true)}) | |||||
| public ResultData list(@ModelAttribute WxMsgSignature wxMsgSignature,Integer pageNum, Integer pageSize) { | |||||
| if (null == wxMsgSignature) wxMsgSignature = new WxMsgSignature(); | |||||
| wxMsgSignature.setTenantId(getTenantId()); | |||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | |||||
| public ResultData list(@ModelAttribute WxMsgSignature wxMsgSignature, Integer pageNum, Integer pageSize) { | |||||
| if (null == wxMsgSignature) wxMsgSignature = new WxMsgSignature(); | |||||
| wxMsgSignature.setTenantId(getTenantId()); | |||||
| final PageInfo<WxMsgSignature> page = wxMsgSignatureService.listAsPage(wxMsgSignature, pageNum, pageSize); | final PageInfo<WxMsgSignature> page = wxMsgSignatureService.listAsPage(wxMsgSignature, pageNum, pageSize); | ||||
| return new ResultData(page); | return new ResultData(page); | ||||
| } | } | ||||
| @ApiOperation("新增接口") | |||||
| @ApiOperation("新增接口") | |||||
| @PostMapping("add") | @PostMapping("add") | ||||
| public ResultData add(@RequestBody WxMsgSignature wxMsgSignature) { | public ResultData add(@RequestBody WxMsgSignature wxMsgSignature) { | ||||
| //Assert.notNull(wxMsgSignature.getName(), "角色名不能为空"); | //Assert.notNull(wxMsgSignature.getName(), "角色名不能为空"); | ||||
| @@ -52,17 +51,17 @@ public class WxMsgSignatureController extends BaseController | |||||
| @ApiOperation("根据id删除接口") | @ApiOperation("根据id删除接口") | ||||
| @GetMapping("/del") | @GetMapping("/del") | ||||
| @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | |||||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | |||||
| public ResultData delete(Long id) { | public ResultData delete(Long id) { | ||||
| wxMsgSignatureService.deleteById(id); | wxMsgSignatureService.deleteById(id); | ||||
| return new ResultData(Result.SUCCESS, "删除成功", null); | return new ResultData(Result.SUCCESS, "删除成功", null); | ||||
| } | } | ||||
| @ApiOperation("根据id查询接口") | |||||
| @GetMapping("/findById") | |||||
| @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | |||||
| @ApiOperation("根据id查询接口") | |||||
| @GetMapping("/findById") | |||||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | |||||
| public ResultData findById(Long id) { | public ResultData findById(Long id) { | ||||
| return new ResultData(Result.SUCCESS,"查询成功",wxMsgSignatureService.getById(id)); | |||||
| return new ResultData(Result.SUCCESS, "查询成功", wxMsgSignatureService.getById(id)); | |||||
| } | } | ||||
| @ApiOperation("获取所有数据") | @ApiOperation("获取所有数据") | ||||
| @@ -70,6 +69,6 @@ public class WxMsgSignatureController extends BaseController | |||||
| public ResultData getmodellist() { | public ResultData getmodellist() { | ||||
| return wxMsgSignatureService.getsignaturelist(getTenantId()); | return wxMsgSignatureService.getsignaturelist(getTenantId()); | ||||
| } | } | ||||
| } | } | ||||
| @@ -7,19 +7,19 @@ import com.simple.domain.po.WxMsgValidationcode; | |||||
| import com.simple.service.WxMsgValidationcodeService; | import com.simple.service.WxMsgValidationcodeService; | ||||
| import io.swagger.annotations.ApiImplicitParam; | import io.swagger.annotations.ApiImplicitParam; | ||||
| import io.swagger.annotations.ApiImplicitParams; | import io.swagger.annotations.ApiImplicitParams; | ||||
| import org.apache.log4j.Logger; | |||||
| import org.slf4j.Logger; | |||||
| import org.slf4j.LoggerFactory; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.web.bind.annotation.*; | import org.springframework.web.bind.annotation.*; | ||||
| @RestController | @RestController | ||||
| @RequestMapping("wxMsgValidationcode") | @RequestMapping("wxMsgValidationcode") | ||||
| public class WxMsgValidationcodeController extends BaseController | |||||
| { | |||||
| public class WxMsgValidationcodeController extends BaseController { | |||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||||
| @Autowired | @Autowired | ||||
| private WxMsgValidationcodeService wxMsgValidationcodeService; | private WxMsgValidationcodeService wxMsgValidationcodeService; | ||||
| private Logger logger = Logger.getLogger(WxMsgValidationcodeController.class); | |||||
| @GetMapping("list") | @GetMapping("list") | ||||
| @ApiImplicitParams({ | @ApiImplicitParams({ | ||||
| @ApiImplicitParam(name="pageNum",value="页数",dataType="int", paramType = "query",required=true), | @ApiImplicitParam(name="pageNum",value="页数",dataType="int", paramType = "query",required=true), | ||||
| @@ -7,25 +7,25 @@ import com.simple.domain.po.WxMsgValidationcodeModel; | |||||
| import com.simple.service.WxMsgValidationcodeModelService; | import com.simple.service.WxMsgValidationcodeModelService; | ||||
| import io.swagger.annotations.ApiImplicitParam; | import io.swagger.annotations.ApiImplicitParam; | ||||
| import io.swagger.annotations.ApiImplicitParams; | import io.swagger.annotations.ApiImplicitParams; | ||||
| import org.apache.log4j.Logger; | |||||
| import org.slf4j.Logger; | |||||
| import org.slf4j.LoggerFactory; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.web.bind.annotation.*; | import org.springframework.web.bind.annotation.*; | ||||
| @RestController | @RestController | ||||
| @RequestMapping("wxMsgValidationcodeModel") | @RequestMapping("wxMsgValidationcodeModel") | ||||
| public class WxMsgValidationcodeModelController extends BaseController | |||||
| { | |||||
| @Autowired | |||||
| private WxMsgValidationcodeModelService wxMsgValidationcodeModelService; | |||||
| public class WxMsgValidationcodeModelController extends BaseController { | |||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||||
| private Logger logger = Logger.getLogger(WxMsgValidationcodeModelController.class); | |||||
| @Autowired | |||||
| private WxMsgValidationcodeModelService wxMsgValidationcodeModelService; | |||||
| @GetMapping("list") | @GetMapping("list") | ||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name="pageNum",value="页数",dataType="int", paramType = "query",required=true), | |||||
| @ApiImplicitParam(name="pageSize",value="每页条数",dataType="int", paramType = "query",required=true)}) | |||||
| public ResultData list(@ModelAttribute WxMsgValidationcodeModel wxMsgValidationcodeModel,Integer pageNum, Integer pageSize) { | |||||
| if (null == wxMsgValidationcodeModel) wxMsgValidationcodeModel = new WxMsgValidationcodeModel(); | |||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | |||||
| public ResultData list(@ModelAttribute WxMsgValidationcodeModel wxMsgValidationcodeModel, Integer pageNum, Integer pageSize) { | |||||
| if (null == wxMsgValidationcodeModel) wxMsgValidationcodeModel = new WxMsgValidationcodeModel(); | |||||
| final PageInfo<WxMsgValidationcodeModel> page = wxMsgValidationcodeModelService.listAsPage(wxMsgValidationcodeModel, pageNum, pageSize); | final PageInfo<WxMsgValidationcodeModel> page = wxMsgValidationcodeModelService.listAsPage(wxMsgValidationcodeModel, pageNum, pageSize); | ||||
| return new ResultData(page); | return new ResultData(page); | ||||
| } | } | ||||
| @@ -45,18 +45,17 @@ public class WxMsgValidationcodeModelController extends BaseController | |||||
| } | } | ||||
| @GetMapping("/del") | @GetMapping("/del") | ||||
| @ApiImplicitParam(name="id",value="id",dataType="String", paramType = "query",required=true) | |||||
| @ApiImplicitParam(name = "id", value = "id", dataType = "String", paramType = "query", required = true) | |||||
| public ResultData delete(String id) { | public ResultData delete(String id) { | ||||
| wxMsgValidationcodeModelService.deleteById(id); | wxMsgValidationcodeModelService.deleteById(id); | ||||
| return new ResultData(Result.SUCCESS, "删除成功", null); | return new ResultData(Result.SUCCESS, "删除成功", null); | ||||
| } | } | ||||
| @GetMapping("/findById") | |||||
| @ApiImplicitParam(name="id",value="id",dataType="String", paramType = "query",required=true) | |||||
| @GetMapping("/findById") | |||||
| @ApiImplicitParam(name = "id", value = "id", dataType = "String", paramType = "query", required = true) | |||||
| public ResultData findById(String id) { | public ResultData findById(String id) { | ||||
| return new ResultData(Result.SUCCESS,"查询成功",wxMsgValidationcodeModelService.getById(id)); | |||||
| return new ResultData(Result.SUCCESS, "查询成功", wxMsgValidationcodeModelService.getById(id)); | |||||
| } | } | ||||
| } | } | ||||
| @@ -1,6 +1,7 @@ | |||||
| package com.simple.controller; | package com.simple.controller; | ||||
| import org.apache.log4j.Logger; | |||||
| import org.slf4j.Logger; | |||||
| import org.slf4j.LoggerFactory; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.util.Assert; | import org.springframework.util.Assert; | ||||
| import org.springframework.web.bind.annotation.*; | import org.springframework.web.bind.annotation.*; | ||||
| @@ -17,9 +18,8 @@ import io.swagger.annotations.ApiOperation; | |||||
| @RestController | @RestController | ||||
| @RequestMapping("wxOrder") | @RequestMapping("wxOrder") | ||||
| public class WxOrderController extends BaseController | |||||
| { | |||||
| private Logger logger = Logger.getLogger(WxOrderController.class); | |||||
| public class WxOrderController extends BaseController { | |||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||||
| @Autowired | @Autowired | ||||
| private WxOrderService wxOrderService; | private WxOrderService wxOrderService; | ||||
| @@ -1,41 +1,38 @@ | |||||
| package com.simple.controller; | package com.simple.controller; | ||||
| import org.apache.log4j.Logger; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.util.Assert; | |||||
| import org.springframework.web.bind.annotation.*; | |||||
| import com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| import com.simple.common.Result; | import com.simple.common.Result; | ||||
| import com.simple.common.ResultData; | import com.simple.common.ResultData; | ||||
| import com.simple.domain.po.WxPark; | import com.simple.domain.po.WxPark; | ||||
| import com.simple.service.WxParkService; | import com.simple.service.WxParkService; | ||||
| import io.swagger.annotations.ApiImplicitParam; | import io.swagger.annotations.ApiImplicitParam; | ||||
| import io.swagger.annotations.ApiImplicitParams; | import io.swagger.annotations.ApiImplicitParams; | ||||
| import io.swagger.annotations.ApiOperation; | import io.swagger.annotations.ApiOperation; | ||||
| import org.slf4j.Logger; | |||||
| import org.slf4j.LoggerFactory; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.web.bind.annotation.*; | |||||
| @RestController | @RestController | ||||
| @RequestMapping("wxPark") | @RequestMapping("wxPark") | ||||
| public class WxParkController extends BaseController | |||||
| { | |||||
| @Autowired | |||||
| public class WxParkController extends BaseController { | |||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||||
| @Autowired | |||||
| private WxParkService wxParkService; | private WxParkService wxParkService; | ||||
| private Logger logger = Logger.getLogger(WxParkController.class); | |||||
| @ApiOperation("分页列表接口") | |||||
| @ApiOperation("分页列表接口") | |||||
| @GetMapping("list") | @GetMapping("list") | ||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name="pageNum",value="页数",dataType="int", paramType = "query",required=true), | |||||
| @ApiImplicitParam(name="pageSize",value="每页条数",dataType="int", paramType = "query",required=true)}) | |||||
| public ResultData list(@ModelAttribute WxPark wxPark,Integer pageNum, Integer pageSize) { | |||||
| if (null == wxPark) wxPark = new WxPark(); | |||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | |||||
| public ResultData list(@ModelAttribute WxPark wxPark, Integer pageNum, Integer pageSize) { | |||||
| if (null == wxPark) wxPark = new WxPark(); | |||||
| final PageInfo<WxPark> page = wxParkService.listAsPage(wxPark, pageNum, pageSize); | final PageInfo<WxPark> page = wxParkService.listAsPage(wxPark, pageNum, pageSize); | ||||
| return new ResultData(page); | return new ResultData(page); | ||||
| } | } | ||||
| @ApiOperation("新增接口") | |||||
| @ApiOperation("新增接口") | |||||
| @PostMapping("add") | @PostMapping("add") | ||||
| public ResultData add(@RequestBody WxPark wxPark) { | public ResultData add(@RequestBody WxPark wxPark) { | ||||
| //Assert.notNull(wxPark.getName(), "角色名不能为空"); | //Assert.notNull(wxPark.getName(), "角色名不能为空"); | ||||
| @@ -53,19 +50,18 @@ public class WxParkController extends BaseController | |||||
| @ApiOperation("根据id删除接口") | @ApiOperation("根据id删除接口") | ||||
| @GetMapping("/del") | @GetMapping("/del") | ||||
| @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | |||||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | |||||
| public ResultData delete(Long id) { | public ResultData delete(Long id) { | ||||
| wxParkService.deleteById(id); | wxParkService.deleteById(id); | ||||
| return new ResultData(Result.SUCCESS, "删除成功", null); | return new ResultData(Result.SUCCESS, "删除成功", null); | ||||
| } | } | ||||
| @ApiOperation("根据id查询接口") | |||||
| @GetMapping("/findById") | |||||
| @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | |||||
| @ApiOperation("根据id查询接口") | |||||
| @GetMapping("/findById") | |||||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | |||||
| public ResultData findById(Long id) { | public ResultData findById(Long id) { | ||||
| return new ResultData(Result.SUCCESS,"查询成功",wxParkService.getById(id)); | |||||
| return new ResultData(Result.SUCCESS, "查询成功", wxParkService.getById(id)); | |||||
| } | } | ||||
| } | } | ||||
| @@ -1,6 +1,7 @@ | |||||
| package com.simple.controller; | package com.simple.controller; | ||||
| import org.apache.log4j.Logger; | |||||
| import org.slf4j.Logger; | |||||
| import org.slf4j.LoggerFactory; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.util.Assert; | import org.springframework.util.Assert; | ||||
| import org.springframework.web.bind.annotation.*; | import org.springframework.web.bind.annotation.*; | ||||
| @@ -17,12 +18,11 @@ import io.swagger.annotations.ApiOperation; | |||||
| @RestController | @RestController | ||||
| @RequestMapping("wxPayAccount") | @RequestMapping("wxPayAccount") | ||||
| public class WxPayAccountController extends BaseController | |||||
| { | |||||
| public class WxPayAccountController extends BaseController { | |||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||||
| @Autowired | @Autowired | ||||
| private WxPayAccountService wxPayAccountService; | private WxPayAccountService wxPayAccountService; | ||||
| private Logger logger = Logger.getLogger(WxPayAccountController.class); | |||||
| @ApiOperation("分页列表接口") | @ApiOperation("分页列表接口") | ||||
| @GetMapping("list") | @GetMapping("list") | ||||
| @@ -9,8 +9,9 @@ import com.simple.service.WxProfitSharingOrderService; | |||||
| import com.simple.service.WxRefundOrderService; | import com.simple.service.WxRefundOrderService; | ||||
| import com.simple.utils.XmlUtil; | import com.simple.utils.XmlUtil; | ||||
| import org.apache.commons.io.IOUtils; | import org.apache.commons.io.IOUtils; | ||||
| import org.apache.log4j.Logger; | |||||
| import org.jdom.JDOMException; | import org.jdom.JDOMException; | ||||
| import org.slf4j.Logger; | |||||
| import org.slf4j.LoggerFactory; | |||||
| import org.springframework.http.MediaType; | import org.springframework.http.MediaType; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.web.bind.annotation.*; | import org.springframework.web.bind.annotation.*; | ||||
| @@ -28,7 +29,7 @@ import java.util.TreeMap; | |||||
| @RequestMapping("/wxPay/notify") | @RequestMapping("/wxPay/notify") | ||||
| public class WxPayController extends BaseController { | public class WxPayController extends BaseController { | ||||
| private Logger logger = Logger.getLogger(WxPayController.class); | |||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||||
| @Autowired | @Autowired | ||||
| private WxPayOrderService wxPayOrderService; | private WxPayOrderService wxPayOrderService; | ||||
| @@ -2,7 +2,8 @@ package com.simple.controller; | |||||
| import com.simple.service.WxAppinfoService; | import com.simple.service.WxAppinfoService; | ||||
| import com.simple.service.WxProfitSharingOrderService; | import com.simple.service.WxProfitSharingOrderService; | ||||
| import org.apache.log4j.Logger; | |||||
| import org.slf4j.Logger; | |||||
| import org.slf4j.LoggerFactory; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.web.bind.annotation.*; | import org.springframework.web.bind.annotation.*; | ||||
| @@ -18,9 +19,8 @@ import io.swagger.annotations.ApiOperation; | |||||
| @RestController | @RestController | ||||
| @RequestMapping("wxPayOrder") | @RequestMapping("wxPayOrder") | ||||
| public class WxPayOrderController extends BaseController | |||||
| { | |||||
| private Logger logger = Logger.getLogger(WxPayOrderController.class); | |||||
| public class WxPayOrderController extends BaseController { | |||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||||
| @Autowired | @Autowired | ||||
| private WxPayOrderService wxPayOrderService; | private WxPayOrderService wxPayOrderService; | ||||
| @@ -11,7 +11,8 @@ import com.simple.service.WxProfitSharingReceiverService; | |||||
| import io.swagger.annotations.ApiImplicitParam; | import io.swagger.annotations.ApiImplicitParam; | ||||
| import io.swagger.annotations.ApiImplicitParams; | import io.swagger.annotations.ApiImplicitParams; | ||||
| import io.swagger.annotations.ApiOperation; | import io.swagger.annotations.ApiOperation; | ||||
| import org.apache.log4j.Logger; | |||||
| import org.slf4j.Logger; | |||||
| import org.slf4j.LoggerFactory; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.web.bind.annotation.*; | import org.springframework.web.bind.annotation.*; | ||||
| @@ -20,13 +21,13 @@ import java.util.List; | |||||
| @RestController | @RestController | ||||
| @RequestMapping("wxProfitSharingReceiver") | @RequestMapping("wxProfitSharingReceiver") | ||||
| public class WxProfitSharingReceiverController extends BaseController { | public class WxProfitSharingReceiverController extends BaseController { | ||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||||
| @Autowired | @Autowired | ||||
| private WxProfitSharingReceiverService wxProfitSharingReceiverService; | private WxProfitSharingReceiverService wxProfitSharingReceiverService; | ||||
| @Autowired | @Autowired | ||||
| private WxMerchantService wxMerchantService; | private WxMerchantService wxMerchantService; | ||||
| private Logger logger = Logger.getLogger(WxProfitSharingReceiverController.class); | |||||
| @ApiOperation("分页列表接口") | @ApiOperation("分页列表接口") | ||||
| @GetMapping("list") | @GetMapping("list") | ||||
| @ApiImplicitParams({ | @ApiImplicitParams({ | ||||
| @@ -1,6 +1,7 @@ | |||||
| package com.simple.controller; | package com.simple.controller; | ||||
| import org.apache.log4j.Logger; | |||||
| import org.slf4j.Logger; | |||||
| import org.slf4j.LoggerFactory; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.util.Assert; | import org.springframework.util.Assert; | ||||
| import org.springframework.web.bind.annotation.*; | import org.springframework.web.bind.annotation.*; | ||||
| @@ -20,11 +21,11 @@ import java.util.Map; | |||||
| @RestController | @RestController | ||||
| @RequestMapping("/api/refund") | @RequestMapping("/api/refund") | ||||
| public class WxRefundOrderController extends BaseController { | public class WxRefundOrderController extends BaseController { | ||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||||
| @Autowired | @Autowired | ||||
| private WxRefundOrderService wxRefundOrderService; | private WxRefundOrderService wxRefundOrderService; | ||||
| private Logger logger = Logger.getLogger(WxRefundOrderController.class); | |||||
| @ApiOperation("分页列表接口") | @ApiOperation("分页列表接口") | ||||
| @GetMapping("list") | @GetMapping("list") | ||||
| @@ -7,19 +7,19 @@ import com.simple.domain.po.WxRentContract; | |||||
| import com.simple.service.WxRentContractService; | import com.simple.service.WxRentContractService; | ||||
| import io.swagger.annotations.ApiImplicitParam; | import io.swagger.annotations.ApiImplicitParam; | ||||
| import io.swagger.annotations.ApiImplicitParams; | import io.swagger.annotations.ApiImplicitParams; | ||||
| import org.apache.log4j.Logger; | |||||
| import org.slf4j.Logger; | |||||
| import org.slf4j.LoggerFactory; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.web.bind.annotation.*; | import org.springframework.web.bind.annotation.*; | ||||
| @RestController | @RestController | ||||
| @RequestMapping("wxRentContract") | @RequestMapping("wxRentContract") | ||||
| public class WxRentContractController extends BaseController | |||||
| { | |||||
| public class WxRentContractController extends BaseController { | |||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||||
| @Autowired | @Autowired | ||||
| private WxRentContractService wxRentContractService; | private WxRentContractService wxRentContractService; | ||||
| private Logger logger = Logger.getLogger(WxRentContractController.class); | |||||
| @GetMapping("list") | @GetMapping("list") | ||||
| @ApiImplicitParams({ | @ApiImplicitParams({ | ||||
| @ApiImplicitParam(name="pageNum",value="页数",dataType="int", paramType = "query",required=true), | @ApiImplicitParam(name="pageNum",value="页数",dataType="int", paramType = "query",required=true), | ||||
| @@ -1,41 +1,38 @@ | |||||
| package com.simple.controller; | package com.simple.controller; | ||||
| import org.apache.log4j.Logger; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.util.Assert; | |||||
| import org.springframework.web.bind.annotation.*; | |||||
| import com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| import com.simple.common.Result; | import com.simple.common.Result; | ||||
| import com.simple.common.ResultData; | import com.simple.common.ResultData; | ||||
| import com.simple.domain.po.WxScoreHistory; | import com.simple.domain.po.WxScoreHistory; | ||||
| import com.simple.service.WxScoreHistoryService; | import com.simple.service.WxScoreHistoryService; | ||||
| import io.swagger.annotations.ApiImplicitParam; | import io.swagger.annotations.ApiImplicitParam; | ||||
| import io.swagger.annotations.ApiImplicitParams; | import io.swagger.annotations.ApiImplicitParams; | ||||
| import io.swagger.annotations.ApiOperation; | import io.swagger.annotations.ApiOperation; | ||||
| import org.slf4j.Logger; | |||||
| import org.slf4j.LoggerFactory; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.web.bind.annotation.*; | |||||
| @RestController | @RestController | ||||
| @RequestMapping("wxScoreHistory") | @RequestMapping("wxScoreHistory") | ||||
| public class WxScoreHistoryController extends BaseController | |||||
| { | |||||
| @Autowired | |||||
| public class WxScoreHistoryController extends BaseController { | |||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||||
| @Autowired | |||||
| private WxScoreHistoryService wxScoreHistoryService; | private WxScoreHistoryService wxScoreHistoryService; | ||||
| private Logger logger = Logger.getLogger(WxScoreHistoryController.class); | |||||
| @ApiOperation("分页列表接口") | |||||
| @ApiOperation("分页列表接口") | |||||
| @GetMapping("list") | @GetMapping("list") | ||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name="pageNum",value="页数",dataType="int", paramType = "query",required=true), | |||||
| @ApiImplicitParam(name="pageSize",value="每页条数",dataType="int", paramType = "query",required=true)}) | |||||
| public ResultData list(@ModelAttribute WxScoreHistory wxScoreHistory,Integer pageNum, Integer pageSize) { | |||||
| if (null == wxScoreHistory) wxScoreHistory = new WxScoreHistory(); | |||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | |||||
| public ResultData list(@ModelAttribute WxScoreHistory wxScoreHistory, Integer pageNum, Integer pageSize) { | |||||
| if (null == wxScoreHistory) wxScoreHistory = new WxScoreHistory(); | |||||
| final PageInfo<WxScoreHistory> page = wxScoreHistoryService.listAsPage(wxScoreHistory, pageNum, pageSize); | final PageInfo<WxScoreHistory> page = wxScoreHistoryService.listAsPage(wxScoreHistory, pageNum, pageSize); | ||||
| return new ResultData(page); | return new ResultData(page); | ||||
| } | } | ||||
| @ApiOperation("新增接口") | |||||
| @ApiOperation("新增接口") | |||||
| @PostMapping("add") | @PostMapping("add") | ||||
| public ResultData add(@RequestBody WxScoreHistory wxScoreHistory) { | public ResultData add(@RequestBody WxScoreHistory wxScoreHistory) { | ||||
| //Assert.notNull(wxScoreHistory.getName(), "角色名不能为空"); | //Assert.notNull(wxScoreHistory.getName(), "角色名不能为空"); | ||||
| @@ -53,19 +50,18 @@ public class WxScoreHistoryController extends BaseController | |||||
| @ApiOperation("根据id删除接口") | @ApiOperation("根据id删除接口") | ||||
| @GetMapping("/del") | @GetMapping("/del") | ||||
| @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | |||||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | |||||
| public ResultData delete(Long id) { | public ResultData delete(Long id) { | ||||
| wxScoreHistoryService.deleteById(id); | wxScoreHistoryService.deleteById(id); | ||||
| return new ResultData(Result.SUCCESS, "删除成功", null); | return new ResultData(Result.SUCCESS, "删除成功", null); | ||||
| } | } | ||||
| @ApiOperation("根据id查询接口") | |||||
| @GetMapping("/findById") | |||||
| @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | |||||
| @ApiOperation("根据id查询接口") | |||||
| @GetMapping("/findById") | |||||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | |||||
| public ResultData findById(Long id) { | public ResultData findById(Long id) { | ||||
| return new ResultData(Result.SUCCESS,"查询成功",wxScoreHistoryService.getById(id)); | |||||
| return new ResultData(Result.SUCCESS, "查询成功", wxScoreHistoryService.getById(id)); | |||||
| } | } | ||||
| } | } | ||||
| @@ -1,50 +1,46 @@ | |||||
| package com.simple.controller; | package com.simple.controller; | ||||
| import org.apache.log4j.Logger; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.util.Assert; | |||||
| import org.springframework.web.bind.annotation.*; | |||||
| import com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| import com.simple.common.Result; | import com.simple.common.Result; | ||||
| import com.simple.common.ResultData; | import com.simple.common.ResultData; | ||||
| import com.simple.domain.po.WxScoreRules; | import com.simple.domain.po.WxScoreRules; | ||||
| import com.simple.service.WxScoreRulesService; | import com.simple.service.WxScoreRulesService; | ||||
| import io.swagger.annotations.Api; | import io.swagger.annotations.Api; | ||||
| import io.swagger.annotations.ApiImplicitParam; | import io.swagger.annotations.ApiImplicitParam; | ||||
| import io.swagger.annotations.ApiImplicitParams; | import io.swagger.annotations.ApiImplicitParams; | ||||
| import io.swagger.annotations.ApiOperation; | import io.swagger.annotations.ApiOperation; | ||||
| import org.slf4j.Logger; | |||||
| import org.slf4j.LoggerFactory; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.web.bind.annotation.*; | |||||
| @RestController | @RestController | ||||
| @RequestMapping("wxScoreRules") | @RequestMapping("wxScoreRules") | ||||
| @Api(description="成长值规则相关接口") | |||||
| public class WxScoreRulesController extends BaseController | |||||
| { | |||||
| @Autowired | |||||
| @Api(description = "成长值规则相关接口") | |||||
| public class WxScoreRulesController extends BaseController { | |||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||||
| @Autowired | |||||
| private WxScoreRulesService wxScoreRulesService; | private WxScoreRulesService wxScoreRulesService; | ||||
| private Logger logger = Logger.getLogger(WxScoreRulesController.class); | |||||
| @ApiOperation("分页列表接口") | |||||
| @ApiOperation("分页列表接口") | |||||
| @GetMapping("list") | @GetMapping("list") | ||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name="pageNum",value="页数",dataType="int", paramType = "query",required=true), | |||||
| @ApiImplicitParam(name="pageSize",value="每页条数",dataType="int", paramType = "query",required=true)}) | |||||
| public ResultData list(@ModelAttribute WxScoreRules wxScoreRules,Integer pageNum, Integer pageSize) { | |||||
| if (null == wxScoreRules) wxScoreRules = new WxScoreRules(); | |||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | |||||
| public ResultData list(@ModelAttribute WxScoreRules wxScoreRules, Integer pageNum, Integer pageSize) { | |||||
| if (null == wxScoreRules) wxScoreRules = new WxScoreRules(); | |||||
| final PageInfo<WxScoreRules> page = wxScoreRulesService.listAsPage(wxScoreRules, pageNum, pageSize); | final PageInfo<WxScoreRules> page = wxScoreRulesService.listAsPage(wxScoreRules, pageNum, pageSize); | ||||
| return new ResultData(page); | return new ResultData(page); | ||||
| } | } | ||||
| @ApiOperation("新增接口") | |||||
| @ApiOperation("新增接口") | |||||
| @PostMapping("add") | @PostMapping("add") | ||||
| public ResultData add(@RequestBody WxScoreRules wxScoreRules) { | public ResultData add(@RequestBody WxScoreRules wxScoreRules) { | ||||
| //Assert.notNull(wxScoreRules.getName(), "角色名不能为空"); | //Assert.notNull(wxScoreRules.getName(), "角色名不能为空"); | ||||
| //Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名"); | //Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名"); | ||||
| wxScoreRules.setTenantId(getTenantId()); | |||||
| wxScoreRulesService.saveOrUpdate(wxScoreRules); | |||||
| wxScoreRules.setTenantId(getTenantId()); | |||||
| wxScoreRulesService.saveOrUpdate(wxScoreRules); | |||||
| return new ResultData(); | return new ResultData(); | ||||
| } | } | ||||
| @@ -57,19 +53,18 @@ public class WxScoreRulesController extends BaseController | |||||
| @ApiOperation("根据id删除接口") | @ApiOperation("根据id删除接口") | ||||
| @GetMapping("/del") | @GetMapping("/del") | ||||
| @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | |||||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | |||||
| public ResultData delete(Long id) { | public ResultData delete(Long id) { | ||||
| wxScoreRulesService.deleteById(id); | wxScoreRulesService.deleteById(id); | ||||
| return new ResultData(Result.SUCCESS, "删除成功", null); | return new ResultData(Result.SUCCESS, "删除成功", null); | ||||
| } | } | ||||
| @ApiOperation("根据id查询接口") | |||||
| @GetMapping("/findById") | |||||
| @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | |||||
| @ApiOperation("根据id查询接口") | |||||
| @GetMapping("/findById") | |||||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | |||||
| public ResultData findById(Long id) { | public ResultData findById(Long id) { | ||||
| return new ResultData(Result.SUCCESS,"查询成功",wxScoreRulesService.getById(id)); | |||||
| return new ResultData(Result.SUCCESS, "查询成功", wxScoreRulesService.getById(id)); | |||||
| } | } | ||||
| } | } | ||||
| @@ -1,41 +1,38 @@ | |||||
| package com.simple.controller; | package com.simple.controller; | ||||
| import org.apache.log4j.Logger; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.util.Assert; | |||||
| import org.springframework.web.bind.annotation.*; | |||||
| import com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| import com.simple.common.Result; | import com.simple.common.Result; | ||||
| import com.simple.common.ResultData; | import com.simple.common.ResultData; | ||||
| import com.simple.domain.po.WxScoreValidityPeriod; | import com.simple.domain.po.WxScoreValidityPeriod; | ||||
| import com.simple.service.WxScoreValidityPeriodService; | import com.simple.service.WxScoreValidityPeriodService; | ||||
| import io.swagger.annotations.ApiImplicitParam; | import io.swagger.annotations.ApiImplicitParam; | ||||
| import io.swagger.annotations.ApiImplicitParams; | import io.swagger.annotations.ApiImplicitParams; | ||||
| import io.swagger.annotations.ApiOperation; | import io.swagger.annotations.ApiOperation; | ||||
| import org.slf4j.Logger; | |||||
| import org.slf4j.LoggerFactory; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.web.bind.annotation.*; | |||||
| @RestController | @RestController | ||||
| @RequestMapping("wxScoreValidityPeriod") | @RequestMapping("wxScoreValidityPeriod") | ||||
| public class WxScoreValidityPeriodController extends BaseController | |||||
| { | |||||
| @Autowired | |||||
| public class WxScoreValidityPeriodController extends BaseController { | |||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||||
| @Autowired | |||||
| private WxScoreValidityPeriodService wxScoreValidityPeriodService; | private WxScoreValidityPeriodService wxScoreValidityPeriodService; | ||||
| private Logger logger = Logger.getLogger(WxScoreValidityPeriodController.class); | |||||
| @ApiOperation("分页列表接口") | |||||
| @ApiOperation("分页列表接口") | |||||
| @GetMapping("list") | @GetMapping("list") | ||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name="pageNum",value="页数",dataType="int", paramType = "query",required=true), | |||||
| @ApiImplicitParam(name="pageSize",value="每页条数",dataType="int", paramType = "query",required=true)}) | |||||
| public ResultData list(@ModelAttribute WxScoreValidityPeriod wxScoreValidityPeriod,Integer pageNum, Integer pageSize) { | |||||
| if (null == wxScoreValidityPeriod) wxScoreValidityPeriod = new WxScoreValidityPeriod(); | |||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | |||||
| public ResultData list(@ModelAttribute WxScoreValidityPeriod wxScoreValidityPeriod, Integer pageNum, Integer pageSize) { | |||||
| if (null == wxScoreValidityPeriod) wxScoreValidityPeriod = new WxScoreValidityPeriod(); | |||||
| final PageInfo<WxScoreValidityPeriod> page = wxScoreValidityPeriodService.listAsPage(wxScoreValidityPeriod, pageNum, pageSize); | final PageInfo<WxScoreValidityPeriod> page = wxScoreValidityPeriodService.listAsPage(wxScoreValidityPeriod, pageNum, pageSize); | ||||
| return new ResultData(page); | return new ResultData(page); | ||||
| } | } | ||||
| @ApiOperation("新增接口") | |||||
| @ApiOperation("新增接口") | |||||
| @PostMapping("add") | @PostMapping("add") | ||||
| public ResultData add(@RequestBody WxScoreValidityPeriod wxScoreValidityPeriod) { | public ResultData add(@RequestBody WxScoreValidityPeriod wxScoreValidityPeriod) { | ||||
| //Assert.notNull(wxScoreValidityPeriod.getName(), "角色名不能为空"); | //Assert.notNull(wxScoreValidityPeriod.getName(), "角色名不能为空"); | ||||
| @@ -53,19 +50,18 @@ public class WxScoreValidityPeriodController extends BaseController | |||||
| @ApiOperation("根据id删除接口") | @ApiOperation("根据id删除接口") | ||||
| @GetMapping("/del") | @GetMapping("/del") | ||||
| @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | |||||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | |||||
| public ResultData delete(Long id) { | public ResultData delete(Long id) { | ||||
| wxScoreValidityPeriodService.deleteById(id); | wxScoreValidityPeriodService.deleteById(id); | ||||
| return new ResultData(Result.SUCCESS, "删除成功", null); | return new ResultData(Result.SUCCESS, "删除成功", null); | ||||
| } | } | ||||
| @ApiOperation("根据id查询接口") | |||||
| @GetMapping("/findById") | |||||
| @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | |||||
| @ApiOperation("根据id查询接口") | |||||
| @GetMapping("/findById") | |||||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | |||||
| public ResultData findById(Long id) { | public ResultData findById(Long id) { | ||||
| return new ResultData(Result.SUCCESS,"查询成功",wxScoreValidityPeriodService.getById(id)); | |||||
| return new ResultData(Result.SUCCESS, "查询成功", wxScoreValidityPeriodService.getById(id)); | |||||
| } | } | ||||
| } | } | ||||
| @@ -3,13 +3,13 @@ package com.simple.controller; | |||||
| import com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| import com.simple.common.Result; | import com.simple.common.Result; | ||||
| import com.simple.common.ResultData; | import com.simple.common.ResultData; | ||||
| import com.simple.domain.po.WxShop; | import com.simple.domain.po.WxShop; | ||||
| import com.simple.service.WxShopService; | import com.simple.service.WxShopService; | ||||
| import io.swagger.annotations.ApiImplicitParam; | import io.swagger.annotations.ApiImplicitParam; | ||||
| import io.swagger.annotations.ApiImplicitParams; | import io.swagger.annotations.ApiImplicitParams; | ||||
| import io.swagger.annotations.ApiOperation; | import io.swagger.annotations.ApiOperation; | ||||
| import org.apache.log4j.Logger; | |||||
| import org.slf4j.Logger; | |||||
| import org.slf4j.LoggerFactory; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.web.bind.annotation.*; | import org.springframework.web.bind.annotation.*; | ||||
| @@ -17,28 +17,27 @@ import java.util.Map; | |||||
| @RestController | @RestController | ||||
| @RequestMapping("wxShop") | @RequestMapping("wxShop") | ||||
| public class WxShopController extends BaseController | |||||
| { | |||||
| @Autowired | |||||
| private WxShopService wxShopService; | |||||
| public class WxShopController extends BaseController { | |||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||||
| private Logger logger = Logger.getLogger(WxShopController.class); | |||||
| @Autowired | |||||
| private WxShopService wxShopService; | |||||
| @ApiOperation("分页列表接口") | @ApiOperation("分页列表接口") | ||||
| @GetMapping("list") | @GetMapping("list") | ||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name="pageNum",value="页数",dataType="int", paramType = "query",required=true), | |||||
| @ApiImplicitParam(name="pageSize",value="每页条数",dataType="int", paramType = "query",required=true)}) | |||||
| public ResultData list(@ModelAttribute WxShop wxShop,Integer pageNum, Integer pageSize) { | |||||
| if (null == wxShop) wxShop = new WxShop(); | |||||
| wxShop.setTenantId(getTenantId()); | |||||
| wxShop.setSortColumns(WxShop.Field.Id_DESC); | |||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | |||||
| public ResultData list(@ModelAttribute WxShop wxShop, Integer pageNum, Integer pageSize) { | |||||
| if (null == wxShop) wxShop = new WxShop(); | |||||
| wxShop.setTenantId(getTenantId()); | |||||
| wxShop.setSortColumns(WxShop.Field.Id_DESC); | |||||
| final PageInfo<Map<String,Object>> page = wxShopService.listMapAsPage(wxShop, pageNum, pageSize); | |||||
| final PageInfo<Map<String, Object>> page = wxShopService.listMapAsPage(wxShop, pageNum, pageSize); | |||||
| return new ResultData(page); | return new ResultData(page); | ||||
| } | } | ||||
| @ApiOperation("新增接口") | |||||
| @ApiOperation("新增接口") | |||||
| @PostMapping("add") | @PostMapping("add") | ||||
| public ResultData add(@RequestBody WxShop wxShop) { | public ResultData add(@RequestBody WxShop wxShop) { | ||||
| //Assert.notNull(wxShop.getName(), "角色名不能为空"); | //Assert.notNull(wxShop.getName(), "角色名不能为空"); | ||||
| @@ -57,32 +56,32 @@ public class WxShopController extends BaseController | |||||
| @ApiOperation("根据id删除接口") | @ApiOperation("根据id删除接口") | ||||
| @GetMapping("/del") | @GetMapping("/del") | ||||
| @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | |||||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | |||||
| public ResultData delete(Long id) { | public ResultData delete(Long id) { | ||||
| wxShopService.deleteById(id); | wxShopService.deleteById(id); | ||||
| return new ResultData(Result.SUCCESS, "删除成功", null); | return new ResultData(Result.SUCCESS, "删除成功", null); | ||||
| } | } | ||||
| @ApiOperation("根据id查询接口") | |||||
| @GetMapping("/findById") | |||||
| @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | |||||
| @ApiOperation("根据id查询接口") | |||||
| @GetMapping("/findById") | |||||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | |||||
| public ResultData findById(Long id) { | public ResultData findById(Long id) { | ||||
| return new ResultData(Result.SUCCESS,"查询成功",wxShopService.getById(id)); | |||||
| return new ResultData(Result.SUCCESS, "查询成功", wxShopService.getById(id)); | |||||
| } | } | ||||
| @ApiOperation("获取商铺数据") | @ApiOperation("获取商铺数据") | ||||
| @GetMapping("getShopListByShopNumber") | @GetMapping("getShopListByShopNumber") | ||||
| @ApiImplicitParam(name="shopNumber",value="shopNumber",dataType="String", paramType = "query",required=true) | |||||
| @ApiImplicitParam(name = "shopNumber", value = "shopNumber", dataType = "String", paramType = "query", required = true) | |||||
| public ResultData getbshoplist(String shopNumber) { | public ResultData getbshoplist(String shopNumber) { | ||||
| return wxShopService.getbshoplist(getTenantId(),shopNumber); | |||||
| return wxShopService.getbshoplist(getTenantId(), shopNumber); | |||||
| } | } | ||||
| @ApiOperation("获取商户商铺数据") | @ApiOperation("获取商户商铺数据") | ||||
| @GetMapping("getMerchantShopByShopId") | @GetMapping("getMerchantShopByShopId") | ||||
| @ApiImplicitParam(name="shopId",value="shopId",dataType="String", paramType = "query",required=true) | |||||
| @ApiImplicitParam(name = "shopId", value = "shopId", dataType = "String", paramType = "query", required = true) | |||||
| public ResultData getMerchantShopByShopId(String shopId) { | public ResultData getMerchantShopByShopId(String shopId) { | ||||
| return wxShopService.getMerchantShopByShopId(getTenantId(),shopId); | |||||
| return wxShopService.getMerchantShopByShopId(getTenantId(), shopId); | |||||
| } | } | ||||
| } | } | ||||
| @@ -6,7 +6,8 @@ import java.util.HashMap; | |||||
| import java.util.List; | import java.util.List; | ||||
| import java.util.Map; | import java.util.Map; | ||||
| import org.apache.log4j.Logger; | |||||
| import org.slf4j.Logger; | |||||
| import org.slf4j.LoggerFactory; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.web.bind.annotation.GetMapping; | import org.springframework.web.bind.annotation.GetMapping; | ||||
| import org.springframework.web.bind.annotation.RequestMapping; | import org.springframework.web.bind.annotation.RequestMapping; | ||||
| @@ -26,16 +27,15 @@ import io.swagger.annotations.ApiOperation; | |||||
| @RestController | @RestController | ||||
| @RequestMapping("wxTags") | @RequestMapping("wxTags") | ||||
| @Api(description="标签弹窗接口") | @Api(description="标签弹窗接口") | ||||
| public class WxTagsController extends BaseController | |||||
| { | |||||
| public class WxTagsController extends BaseController { | |||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||||
| @Autowired | @Autowired | ||||
| private WxTagsService wxTagsService; | private WxTagsService wxTagsService; | ||||
| @Autowired | @Autowired | ||||
| private WxCUserTagsService wxCUserTagsService; | private WxCUserTagsService wxCUserTagsService; | ||||
| private Logger logger = Logger.getLogger(WxTagsController.class); | |||||
| @GetMapping("getAllList") | @GetMapping("getAllList") | ||||
| @ApiOperation("标签弹窗接口") | @ApiOperation("标签弹窗接口") | ||||
| public ResultData getAllList() { | public ResultData getAllList() { | ||||
| @@ -1,41 +1,37 @@ | |||||
| package com.simple.controller; | package com.simple.controller; | ||||
| import org.apache.log4j.Logger; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.util.Assert; | |||||
| import org.springframework.web.bind.annotation.*; | |||||
| import com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| import com.simple.common.Result; | import com.simple.common.Result; | ||||
| import com.simple.common.ResultData; | import com.simple.common.ResultData; | ||||
| import com.simple.domain.po.WxUserChannel; | import com.simple.domain.po.WxUserChannel; | ||||
| import com.simple.service.WxUserChannelService; | import com.simple.service.WxUserChannelService; | ||||
| import io.swagger.annotations.ApiImplicitParam; | import io.swagger.annotations.ApiImplicitParam; | ||||
| import io.swagger.annotations.ApiImplicitParams; | import io.swagger.annotations.ApiImplicitParams; | ||||
| import io.swagger.annotations.ApiOperation; | import io.swagger.annotations.ApiOperation; | ||||
| import org.slf4j.Logger; | |||||
| import org.slf4j.LoggerFactory; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.web.bind.annotation.*; | |||||
| @RestController | @RestController | ||||
| @RequestMapping("wxUserChannel") | @RequestMapping("wxUserChannel") | ||||
| public class WxUserChannelController extends BaseController | |||||
| { | |||||
| @Autowired | |||||
| public class WxUserChannelController extends BaseController { | |||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||||
| @Autowired | |||||
| private WxUserChannelService wxUserChannelService; | private WxUserChannelService wxUserChannelService; | ||||
| private Logger logger = Logger.getLogger(WxUserChannelController.class); | |||||
| @ApiOperation("分页列表接口") | |||||
| @ApiOperation("分页列表接口") | |||||
| @GetMapping("list") | @GetMapping("list") | ||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name="pageNum",value="页数",dataType="int", paramType = "query",required=true), | |||||
| @ApiImplicitParam(name="pageSize",value="每页条数",dataType="int", paramType = "query",required=true)}) | |||||
| public ResultData list(@ModelAttribute WxUserChannel wxUserChannel,Integer pageNum, Integer pageSize) { | |||||
| if (null == wxUserChannel) wxUserChannel = new WxUserChannel(); | |||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | |||||
| public ResultData list(@ModelAttribute WxUserChannel wxUserChannel, Integer pageNum, Integer pageSize) { | |||||
| if (null == wxUserChannel) wxUserChannel = new WxUserChannel(); | |||||
| final PageInfo<WxUserChannel> page = wxUserChannelService.listAsPage(wxUserChannel, pageNum, pageSize); | final PageInfo<WxUserChannel> page = wxUserChannelService.listAsPage(wxUserChannel, pageNum, pageSize); | ||||
| return new ResultData(page); | return new ResultData(page); | ||||
| } | } | ||||
| @ApiOperation("新增接口") | |||||
| @ApiOperation("新增接口") | |||||
| @PostMapping("add") | @PostMapping("add") | ||||
| public ResultData add(@RequestBody WxUserChannel wxUserChannel) { | public ResultData add(@RequestBody WxUserChannel wxUserChannel) { | ||||
| //Assert.notNull(wxUserChannel.getName(), "角色名不能为空"); | //Assert.notNull(wxUserChannel.getName(), "角色名不能为空"); | ||||
| @@ -53,19 +49,18 @@ public class WxUserChannelController extends BaseController | |||||
| @ApiOperation("根据id删除接口") | @ApiOperation("根据id删除接口") | ||||
| @GetMapping("/del") | @GetMapping("/del") | ||||
| @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | |||||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | |||||
| public ResultData delete(Long id) { | public ResultData delete(Long id) { | ||||
| wxUserChannelService.deleteById(id); | wxUserChannelService.deleteById(id); | ||||
| return new ResultData(Result.SUCCESS, "删除成功", null); | return new ResultData(Result.SUCCESS, "删除成功", null); | ||||
| } | } | ||||
| @ApiOperation("根据id查询接口") | |||||
| @GetMapping("/findById") | |||||
| @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | |||||
| @ApiOperation("根据id查询接口") | |||||
| @GetMapping("/findById") | |||||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | |||||
| public ResultData findById(Long id) { | public ResultData findById(Long id) { | ||||
| return new ResultData(Result.SUCCESS,"查询成功",wxUserChannelService.getById(id)); | |||||
| return new ResultData(Result.SUCCESS, "查询成功", wxUserChannelService.getById(id)); | |||||
| } | } | ||||
| } | } | ||||
| @@ -5,6 +5,8 @@ import com.simple.common.ResultData; | |||||
| import com.simple.domain.dto.WxUserCouponDto; | import com.simple.domain.dto.WxUserCouponDto; | ||||
| import com.simple.service.WxUserCouponService; | import com.simple.service.WxUserCouponService; | ||||
| import io.swagger.annotations.ApiOperation; | import io.swagger.annotations.ApiOperation; | ||||
| import org.slf4j.Logger; | |||||
| import org.slf4j.LoggerFactory; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.web.bind.annotation.PostMapping; | import org.springframework.web.bind.annotation.PostMapping; | ||||
| import org.springframework.web.bind.annotation.RequestBody; | import org.springframework.web.bind.annotation.RequestBody; | ||||
| @@ -17,6 +19,7 @@ import org.springframework.web.bind.annotation.RestController; | |||||
| @RestController | @RestController | ||||
| @RequestMapping("wxUserCoupon") | @RequestMapping("wxUserCoupon") | ||||
| public class WxUserCouponController { | public class WxUserCouponController { | ||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||||
| @Autowired | @Autowired | ||||
| @@ -1,20 +1,5 @@ | |||||
| package com.simple.controller; | package com.simple.controller; | ||||
| import java.text.NumberFormat; | |||||
| import java.text.SimpleDateFormat; | |||||
| import java.util.ArrayList; | |||||
| import java.util.Calendar; | |||||
| import java.util.Date; | |||||
| import java.util.HashMap; | |||||
| import java.util.List; | |||||
| import java.util.Map; | |||||
| import org.apache.commons.lang3.StringUtils; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.web.bind.annotation.GetMapping; | |||||
| import org.springframework.web.bind.annotation.RequestMapping; | |||||
| import org.springframework.web.bind.annotation.RestController; | |||||
| import com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| import com.simple.common.ResultData; | import com.simple.common.ResultData; | ||||
| import com.simple.domain.dto.WxCUserBasicInfoDto; | import com.simple.domain.dto.WxCUserBasicInfoDto; | ||||
| @@ -25,228 +10,235 @@ import com.simple.enums.EnumAgeInfo; | |||||
| import com.simple.service.WxCUserBasicInfoService; | import com.simple.service.WxCUserBasicInfoService; | ||||
| import com.simple.service.WxCUserService; | import com.simple.service.WxCUserService; | ||||
| import com.simple.service.WxUserChannelService; | import com.simple.service.WxUserChannelService; | ||||
| import io.swagger.annotations.Api; | import io.swagger.annotations.Api; | ||||
| import io.swagger.annotations.ApiImplicitParam; | import io.swagger.annotations.ApiImplicitParam; | ||||
| import io.swagger.annotations.ApiImplicitParams; | import io.swagger.annotations.ApiImplicitParams; | ||||
| import io.swagger.annotations.ApiOperation; | import io.swagger.annotations.ApiOperation; | ||||
| import org.apache.commons.lang3.StringUtils; | |||||
| import org.slf4j.Logger; | |||||
| import org.slf4j.LoggerFactory; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.web.bind.annotation.GetMapping; | |||||
| import org.springframework.web.bind.annotation.RequestMapping; | |||||
| import org.springframework.web.bind.annotation.RestController; | |||||
| import java.text.NumberFormat; | |||||
| import java.text.SimpleDateFormat; | |||||
| import java.util.*; | |||||
| @RestController | @RestController | ||||
| @Api(description="会员洞察") | |||||
| @Api(description = "会员洞察") | |||||
| @RequestMapping("userAnalysis") | @RequestMapping("userAnalysis") | ||||
| public class WxUserStructureController extends BaseController{ | |||||
| @Autowired | |||||
| public class WxUserStructureController extends BaseController { | |||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||||
| @Autowired | |||||
| private WxCUserBasicInfoService wxCUserBasicInfoService; | private WxCUserBasicInfoService wxCUserBasicInfoService; | ||||
| @Autowired | |||||
| private WxCUserService wxCUserService; | |||||
| @Autowired | |||||
| private WxUserChannelService wxUserChannelService; | |||||
| @ApiOperation("查询会员性别结构") | |||||
| @GetMapping("/findUserSexStructure") | |||||
| public ResultData findUserSexStructure( | |||||
| Date startTime,Date endTime | |||||
| ) { | |||||
| WxCUserBasicInfoDto dto = new WxCUserBasicInfoDto(); | |||||
| dto.setTenantId(getTenantId()); | |||||
| dto.setStartTime(startTime); | |||||
| if(endTime!=null) { | |||||
| Calendar c = Calendar.getInstance(); | |||||
| c.setTime(endTime); | |||||
| c.add(Calendar.DAY_OF_YEAR, 1); | |||||
| endTime =c.getTime(); | |||||
| } | |||||
| //保密 | |||||
| dto.setSex(0); | |||||
| long secrecy = getCount(dto); | |||||
| dto.setSex(1); | |||||
| long boy = getCount(dto); | |||||
| dto.setSex(2); | |||||
| long girl=getCount(dto); | |||||
| Long all =secrecy+boy+girl; | |||||
| List<UserStructureVo> vos = new ArrayList<>(); | |||||
| vos.add(getVo(boy, all, "男",1)); | |||||
| vos.add(getVo(girl, all, "女",2)); | |||||
| vos.add(getVo(secrecy, all, "保密",3)); | |||||
| return new ResultData(vos); | |||||
| } | |||||
| @ApiOperation("查询会员年龄结构") | |||||
| @GetMapping("/findUserAgeStructure") | |||||
| public ResultData findUserAgeStructure( Date startTime,Date endTime) { | |||||
| WxCUserBasicInfoDto dto = new WxCUserBasicInfoDto(); | |||||
| dto.setTenantId(getTenantId()); | |||||
| dto.setStartTime(startTime); | |||||
| if(endTime!=null) { | |||||
| Calendar c = Calendar.getInstance(); | |||||
| c.setTime(endTime); | |||||
| c.add(Calendar.DAY_OF_YEAR, 1); | |||||
| endTime =c.getTime(); | |||||
| } | |||||
| dto.setEndTime(endTime); | |||||
| long all =wxCUserBasicInfoService.findCountByAge(dto); | |||||
| List<UserStructureVo> vos = new ArrayList<>(); | |||||
| Calendar c = Calendar.getInstance(); | |||||
| for(EnumAgeInfo a:EnumAgeInfo.values()) { | |||||
| c.clear(); | |||||
| c.setTime(new Date()); | |||||
| c.set(Calendar.HOUR_OF_DAY, 0); | |||||
| c.set(Calendar.MINUTE,0); | |||||
| c.set(Calendar.SECOND,0); | |||||
| long count = getCountByAge(a, c,dto); | |||||
| vos.add(getVo(count, all, a.getDesc(),a.getSortNum())); | |||||
| } | |||||
| return new ResultData(vos); | |||||
| } | |||||
| @ApiOperation("查询会员数量") | |||||
| @GetMapping("/findUserDataCount") | |||||
| public ResultData findUserCount(Date startTime,Date endTime) { | |||||
| WxCUserBasicInfoDto dto = new WxCUserBasicInfoDto(); | |||||
| dto.setTenantId(getTenantId()); | |||||
| dto.setStartTime(startTime); | |||||
| if(endTime!=null) { | |||||
| Calendar c = Calendar.getInstance(); | |||||
| c.setTime(endTime); | |||||
| c.add(Calendar.DAY_OF_YEAR, 1); | |||||
| endTime =c.getTime(); | |||||
| } | |||||
| long allCount = wxCUserService.findCount(dto);//总量 | |||||
| Calendar c = Calendar.getInstance(); | |||||
| c.set(Calendar.HOUR_OF_DAY, 0); | |||||
| c.set(Calendar.MINUTE,0); | |||||
| c.set(Calendar.SECOND,0); | |||||
| Date today = c.getTime(); | |||||
| dto.setStartTime(today); | |||||
| dto.setEndTime(null); | |||||
| long todayCount= wxCUserService.findCount( dto);//今天新增 | |||||
| List<UserStructureVo> newCountVos = new ArrayList<>();//每日新增会员数 | |||||
| int j=1; | |||||
| for(int i=29;i>=0;i--) { | |||||
| c.clear(); | |||||
| c.setTime(today); | |||||
| c.add(Calendar.DAY_OF_YEAR, -i); | |||||
| dto.setStartTime(c.getTime()); | |||||
| c.add(Calendar.DAY_OF_YEAR, 1); | |||||
| dto.setEndTime(c.getTime()); | |||||
| long count= wxCUserService.findCount(dto); | |||||
| UserStructureVo vo = new UserStructureVo(); | |||||
| vo.setSortNum(j); | |||||
| j++; | |||||
| vo.setName(new SimpleDateFormat("MM-dd").format(dto.getStartTime())); | |||||
| vo.setCount(count); | |||||
| newCountVos.add(vo); | |||||
| } | |||||
| List<UserStructureVo> allCountVos = new ArrayList<>();//累计会员数 | |||||
| c.clear(); | |||||
| c.setTime(today); | |||||
| c.add(Calendar.DAY_OF_YEAR, -30); | |||||
| dto.setEndTime(c.getTime()); | |||||
| dto.setStartTime(null); | |||||
| long firstDay = wxCUserService.findCount(dto);//统计的第一天总数 | |||||
| int i =0; | |||||
| long sumCount=0; | |||||
| for(UserStructureVo v:newCountVos) { | |||||
| UserStructureVo vo = new UserStructureVo(); | |||||
| sumCount+=v.getCount(); | |||||
| vo.setCount(firstDay+sumCount); | |||||
| vo.setName(v.getName()); | |||||
| vo.setSortNum(i+1); | |||||
| allCountVos.add(vo); | |||||
| i++; | |||||
| } | |||||
| Map<String,Object> map = new HashMap<>(); | |||||
| map.put("allCount", allCount);//累计会员总数 | |||||
| map.put("todayCount", todayCount);//今日新增会员数 | |||||
| map.put("allCountVos", allCountVos);//累计会员列表( 日期和数量list) | |||||
| map.put("newCountVos", newCountVos);//新增会员列表(日期和数量list) | |||||
| return new ResultData(map); | |||||
| } | |||||
| @ApiOperation("拓客分析") | |||||
| @GetMapping("/findUserByChannel") | |||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name="pageNum",value="页数",dataType="int", paramType = "query",required=true), | |||||
| @ApiImplicitParam(name="pageSize",value="每页条数",dataType="int", paramType = "query",required=true)}) | |||||
| public ResultData findUserByChannel(String channelName,Integer pageNum, Integer pageSize) { | |||||
| List<String> sceneList =null; | |||||
| if(StringUtils.isNotBlank(channelName)) { | |||||
| WxUserChannel c= new WxUserChannel(); | |||||
| c.setChannelName(channelName); | |||||
| PageInfo<WxUserChannel> page = wxUserChannelService.listAsPage(c, 1, 100); | |||||
| if(page.getSize()>0) { | |||||
| sceneList = new ArrayList<>(); | |||||
| for(WxUserChannel wuc:page.getList()) { | |||||
| sceneList.add(wuc.getSceneAddress()); | |||||
| } | |||||
| } | |||||
| } | |||||
| PageInfo<WxCUser> page = wxCUserService.listByChannel(sceneList, pageNum, pageSize); | |||||
| for(WxCUser u:page.getList()) { | |||||
| WxUserChannel c= new WxUserChannel(); | |||||
| c.setSceneAddress(u.getSceneAddress()); | |||||
| PageInfo<WxUserChannel> uc = wxUserChannelService.listAsPage(c, 1, 1); | |||||
| if(uc.getSize()>0) { | |||||
| u.setChannelName(uc.getList().get(0).getChannelName()); | |||||
| }else { | |||||
| u.setChannelName("其他来源"); | |||||
| } | |||||
| } | |||||
| return new ResultData(page); | |||||
| } | |||||
| @ApiOperation("获取用户所有渠道") | |||||
| @GetMapping("/findAllUserChannel") | |||||
| public ResultData findAllUserChannel() { | |||||
| List<WxUserChannel> channels=wxUserChannelService.findDistinctChannel(); | |||||
| List<String> vos = new ArrayList<>(); | |||||
| for(WxUserChannel w:channels) { | |||||
| vos.add(w.getChannelName()); | |||||
| } | |||||
| return new ResultData(vos); | |||||
| } | |||||
| private long getCountByAge(EnumAgeInfo a,Calendar c, WxCUserBasicInfoDto dto ) { | |||||
| c.add(Calendar.YEAR, -a.getEnd()); | |||||
| Date startTime = c.getTime(); | |||||
| c.clear(); | |||||
| c.setTime(startTime); | |||||
| c.add(Calendar.YEAR,a.getEnd()-a.getStart()); | |||||
| Date endTime = c.getTime(); | |||||
| dto.setBirthStartTime(startTime); | |||||
| dto.setBirthEndTime(endTime); | |||||
| return wxCUserBasicInfoService.findCountByAge(dto); | |||||
| } | |||||
| //通过性别获取数量 | |||||
| private long getCount(WxCUserBasicInfoDto dto) { | |||||
| // wxCUserBasicInfoService.findCountBySex(dto) basic表与cuser表示对应的,先有cuser 才有basic | |||||
| //所有这里不需要再去查basic | |||||
| return wxCUserService.findCount(dto); | |||||
| } | |||||
| private UserStructureVo getVo(long count,long all,String name,Integer num) { | |||||
| UserStructureVo vo = new UserStructureVo(); | |||||
| vo.setSortNum(num); | |||||
| vo.setName(name); | |||||
| vo.setCount(count); | |||||
| NumberFormat nf = NumberFormat.getPercentInstance(); | |||||
| nf.setMinimumFractionDigits(2);//控制保留小数点后几位,2:表示保留2位小数点 | |||||
| if(all>0) { | |||||
| vo.setPercentage(nf.format(new Long(count).doubleValue()/new Long(all).doubleValue())); | |||||
| }else { | |||||
| vo.setPercentage("0.00%"); | |||||
| } | |||||
| return vo; | |||||
| } | |||||
| @Autowired | |||||
| private WxCUserService wxCUserService; | |||||
| @Autowired | |||||
| private WxUserChannelService wxUserChannelService; | |||||
| @ApiOperation("查询会员性别结构") | |||||
| @GetMapping("/findUserSexStructure") | |||||
| public ResultData findUserSexStructure(Date startTime, Date endTime) { | |||||
| WxCUserBasicInfoDto dto = new WxCUserBasicInfoDto(); | |||||
| dto.setTenantId(getTenantId()); | |||||
| dto.setStartTime(startTime); | |||||
| if (endTime != null) { | |||||
| Calendar c = Calendar.getInstance(); | |||||
| c.setTime(endTime); | |||||
| c.add(Calendar.DAY_OF_YEAR, 1); | |||||
| endTime = c.getTime(); | |||||
| } | |||||
| //保密 | |||||
| dto.setSex(0); | |||||
| long secrecy = getCount(dto); | |||||
| dto.setSex(1); | |||||
| long boy = getCount(dto); | |||||
| dto.setSex(2); | |||||
| long girl = getCount(dto); | |||||
| Long all = secrecy + boy + girl; | |||||
| List<UserStructureVo> vos = new ArrayList<>(); | |||||
| vos.add(getVo(boy, all, "男", 1)); | |||||
| vos.add(getVo(girl, all, "女", 2)); | |||||
| vos.add(getVo(secrecy, all, "保密", 3)); | |||||
| return new ResultData(vos); | |||||
| } | |||||
| @ApiOperation("查询会员年龄结构") | |||||
| @GetMapping("/findUserAgeStructure") | |||||
| public ResultData findUserAgeStructure(Date startTime, Date endTime) { | |||||
| WxCUserBasicInfoDto dto = new WxCUserBasicInfoDto(); | |||||
| dto.setTenantId(getTenantId()); | |||||
| dto.setStartTime(startTime); | |||||
| if (endTime != null) { | |||||
| Calendar c = Calendar.getInstance(); | |||||
| c.setTime(endTime); | |||||
| c.add(Calendar.DAY_OF_YEAR, 1); | |||||
| endTime = c.getTime(); | |||||
| } | |||||
| dto.setEndTime(endTime); | |||||
| long all = wxCUserBasicInfoService.findCountByAge(dto); | |||||
| List<UserStructureVo> vos = new ArrayList<>(); | |||||
| Calendar c = Calendar.getInstance(); | |||||
| for (EnumAgeInfo a : EnumAgeInfo.values()) { | |||||
| c.clear(); | |||||
| c.setTime(new Date()); | |||||
| c.set(Calendar.HOUR_OF_DAY, 0); | |||||
| c.set(Calendar.MINUTE, 0); | |||||
| c.set(Calendar.SECOND, 0); | |||||
| long count = getCountByAge(a, c, dto); | |||||
| vos.add(getVo(count, all, a.getDesc(), a.getSortNum())); | |||||
| } | |||||
| return new ResultData(vos); | |||||
| } | |||||
| @ApiOperation("查询会员数量") | |||||
| @GetMapping("/findUserDataCount") | |||||
| public ResultData findUserCount(Date startTime, Date endTime) { | |||||
| WxCUserBasicInfoDto dto = new WxCUserBasicInfoDto(); | |||||
| dto.setTenantId(getTenantId()); | |||||
| dto.setStartTime(startTime); | |||||
| if (endTime != null) { | |||||
| Calendar c = Calendar.getInstance(); | |||||
| c.setTime(endTime); | |||||
| c.add(Calendar.DAY_OF_YEAR, 1); | |||||
| endTime = c.getTime(); | |||||
| } | |||||
| long allCount = wxCUserService.findCount(dto);//总量 | |||||
| Calendar c = Calendar.getInstance(); | |||||
| c.set(Calendar.HOUR_OF_DAY, 0); | |||||
| c.set(Calendar.MINUTE, 0); | |||||
| c.set(Calendar.SECOND, 0); | |||||
| Date today = c.getTime(); | |||||
| dto.setStartTime(today); | |||||
| dto.setEndTime(null); | |||||
| long todayCount = wxCUserService.findCount(dto);//今天新增 | |||||
| List<UserStructureVo> newCountVos = new ArrayList<>();//每日新增会员数 | |||||
| int j = 1; | |||||
| for (int i = 29; i >= 0; i--) { | |||||
| c.clear(); | |||||
| c.setTime(today); | |||||
| c.add(Calendar.DAY_OF_YEAR, -i); | |||||
| dto.setStartTime(c.getTime()); | |||||
| c.add(Calendar.DAY_OF_YEAR, 1); | |||||
| dto.setEndTime(c.getTime()); | |||||
| long count = wxCUserService.findCount(dto); | |||||
| UserStructureVo vo = new UserStructureVo(); | |||||
| vo.setSortNum(j); | |||||
| j++; | |||||
| vo.setName(new SimpleDateFormat("MM-dd").format(dto.getStartTime())); | |||||
| vo.setCount(count); | |||||
| newCountVos.add(vo); | |||||
| } | |||||
| List<UserStructureVo> allCountVos = new ArrayList<>();//累计会员数 | |||||
| c.clear(); | |||||
| c.setTime(today); | |||||
| c.add(Calendar.DAY_OF_YEAR, -30); | |||||
| dto.setEndTime(c.getTime()); | |||||
| dto.setStartTime(null); | |||||
| long firstDay = wxCUserService.findCount(dto);//统计的第一天总数 | |||||
| int i = 0; | |||||
| long sumCount = 0; | |||||
| for (UserStructureVo v : newCountVos) { | |||||
| UserStructureVo vo = new UserStructureVo(); | |||||
| sumCount += v.getCount(); | |||||
| vo.setCount(firstDay + sumCount); | |||||
| vo.setName(v.getName()); | |||||
| vo.setSortNum(i + 1); | |||||
| allCountVos.add(vo); | |||||
| i++; | |||||
| } | |||||
| Map<String, Object> map = new HashMap<>(); | |||||
| map.put("allCount", allCount);//累计会员总数 | |||||
| map.put("todayCount", todayCount);//今日新增会员数 | |||||
| map.put("allCountVos", allCountVos);//累计会员列表( 日期和数量list) | |||||
| map.put("newCountVos", newCountVos);//新增会员列表(日期和数量list) | |||||
| return new ResultData(map); | |||||
| } | |||||
| @ApiOperation("拓客分析") | |||||
| @GetMapping("/findUserByChannel") | |||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | |||||
| public ResultData findUserByChannel(String channelName, Integer pageNum, Integer pageSize) { | |||||
| List<String> sceneList = null; | |||||
| if (StringUtils.isNotBlank(channelName)) { | |||||
| WxUserChannel c = new WxUserChannel(); | |||||
| c.setChannelName(channelName); | |||||
| PageInfo<WxUserChannel> page = wxUserChannelService.listAsPage(c, 1, 100); | |||||
| if (page.getSize() > 0) { | |||||
| sceneList = new ArrayList<>(); | |||||
| for (WxUserChannel wuc : page.getList()) { | |||||
| sceneList.add(wuc.getSceneAddress()); | |||||
| } | |||||
| } | |||||
| } | |||||
| PageInfo<WxCUser> page = wxCUserService.listByChannel(sceneList, pageNum, pageSize); | |||||
| for (WxCUser u : page.getList()) { | |||||
| WxUserChannel c = new WxUserChannel(); | |||||
| c.setSceneAddress(u.getSceneAddress()); | |||||
| PageInfo<WxUserChannel> uc = wxUserChannelService.listAsPage(c, 1, 1); | |||||
| if (uc.getSize() > 0) { | |||||
| u.setChannelName(uc.getList().get(0).getChannelName()); | |||||
| } else { | |||||
| u.setChannelName("其他来源"); | |||||
| } | |||||
| } | |||||
| return new ResultData(page); | |||||
| } | |||||
| @ApiOperation("获取用户所有渠道") | |||||
| @GetMapping("/findAllUserChannel") | |||||
| public ResultData findAllUserChannel() { | |||||
| List<WxUserChannel> channels = wxUserChannelService.findDistinctChannel(); | |||||
| List<String> vos = new ArrayList<>(); | |||||
| for (WxUserChannel w : channels) { | |||||
| vos.add(w.getChannelName()); | |||||
| } | |||||
| return new ResultData(vos); | |||||
| } | |||||
| private long getCountByAge(EnumAgeInfo a, Calendar c, WxCUserBasicInfoDto dto) { | |||||
| c.add(Calendar.YEAR, -a.getEnd()); | |||||
| Date startTime = c.getTime(); | |||||
| c.clear(); | |||||
| c.setTime(startTime); | |||||
| c.add(Calendar.YEAR, a.getEnd() - a.getStart()); | |||||
| Date endTime = c.getTime(); | |||||
| dto.setBirthStartTime(startTime); | |||||
| dto.setBirthEndTime(endTime); | |||||
| return wxCUserBasicInfoService.findCountByAge(dto); | |||||
| } | |||||
| //通过性别获取数量 | |||||
| private long getCount(WxCUserBasicInfoDto dto) { | |||||
| // wxCUserBasicInfoService.findCountBySex(dto) basic表与cuser表示对应的,先有cuser 才有basic | |||||
| //所有这里不需要再去查basic | |||||
| return wxCUserService.findCount(dto); | |||||
| } | |||||
| private UserStructureVo getVo(long count, long all, String name, Integer num) { | |||||
| UserStructureVo vo = new UserStructureVo(); | |||||
| vo.setSortNum(num); | |||||
| vo.setName(name); | |||||
| vo.setCount(count); | |||||
| NumberFormat nf = NumberFormat.getPercentInstance(); | |||||
| nf.setMinimumFractionDigits(2);//控制保留小数点后几位,2:表示保留2位小数点 | |||||
| if (all > 0) { | |||||
| vo.setPercentage(nf.format(new Long(count).doubleValue() / new Long(all).doubleValue())); | |||||
| } else { | |||||
| vo.setPercentage("0.00%"); | |||||
| } | |||||
| return vo; | |||||
| } | |||||
| } | } | ||||