| @@ -7,10 +7,15 @@ import java.util.Date; | |||||
| import com.iformall.domain.po.MallUserInfo; | import com.iformall.domain.po.MallUserInfo; | ||||
| import com.iformall.shiro.UserSession; | import com.iformall.shiro.UserSession; | ||||
| import com.iformall.utils.IPUtil; | |||||
| import org.apache.shiro.SecurityUtils; | import org.apache.shiro.SecurityUtils; | ||||
| import org.springframework.web.bind.WebDataBinder; | import org.springframework.web.bind.WebDataBinder; | ||||
| import org.springframework.web.bind.annotation.InitBinder; | import org.springframework.web.bind.annotation.InitBinder; | ||||
| import org.springframework.web.bind.annotation.RestController; | import org.springframework.web.bind.annotation.RestController; | ||||
| import org.springframework.web.context.request.RequestContextHolder; | |||||
| import org.springframework.web.context.request.ServletRequestAttributes; | |||||
| import javax.servlet.http.HttpServletRequest; | |||||
| @RestController | @RestController | ||||
| public class BaseController { | public class BaseController { | ||||
| @@ -44,4 +49,10 @@ public class BaseController { | |||||
| String tenantId = (String)SecurityUtils.getSubject().getSession().getAttribute(UserSession.tenantId); | String tenantId = (String)SecurityUtils.getSubject().getSession().getAttribute(UserSession.tenantId); | ||||
| return tenantId; | return tenantId; | ||||
| } | } | ||||
| public String getIpAddr() { | |||||
| HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); | |||||
| String ipaddress = IPUtil.getIpAddr(request); | |||||
| return ipaddress; | |||||
| } | |||||
| } | } | ||||
| @@ -26,6 +26,7 @@ public class DataTowerController extends BaseController { | |||||
| @ApiOperation("查询运营") | @ApiOperation("查询运营") | ||||
| @PostMapping("/queryRunningPotal") | @PostMapping("/queryRunningPotal") | ||||
| public ResultData queryRunningPotal() { | public ResultData queryRunningPotal() { | ||||
| logger.debug("[" + getIpAddr() + "] DataTowerController::queryRunningPotal"); | |||||
| Map<String, Object> data = dataTowerService.queryRunningPotal(getTenantId()); | Map<String, Object> data = dataTowerService.queryRunningPotal(getTenantId()); | ||||
| @@ -35,6 +36,7 @@ public class DataTowerController extends BaseController { | |||||
| @ApiOperation("查询运营") | @ApiOperation("查询运营") | ||||
| @PostMapping("/queryRunningMobile") | @PostMapping("/queryRunningMobile") | ||||
| public ResultData queryRunningMobile() { | public ResultData queryRunningMobile() { | ||||
| logger.debug("[" + getIpAddr() + "] DataTowerController::queryRunningMobile"); | |||||
| Map<String, Object> data = dataTowerService.queryRunningMobile(getTenantId()); | Map<String, Object> data = dataTowerService.queryRunningMobile(getTenantId()); | ||||
| @@ -45,6 +47,7 @@ public class DataTowerController extends BaseController { | |||||
| @ApiOperation("查询运营") | @ApiOperation("查询运营") | ||||
| @PostMapping("/queryRunning") | @PostMapping("/queryRunning") | ||||
| public ResultData queryRunning() { | public ResultData queryRunning() { | ||||
| logger.debug("[" + getIpAddr() + "] DataTowerController::queryRunning"); | |||||
| Map<String, Object> data = dataTowerService.queryRunning(getTenantId()); | Map<String, Object> data = dataTowerService.queryRunning(getTenantId()); | ||||
| @@ -55,6 +58,7 @@ public class DataTowerController extends BaseController { | |||||
| @ApiOperation("查询车流") | @ApiOperation("查询车流") | ||||
| @PostMapping("/queryCar") | @PostMapping("/queryCar") | ||||
| public ResultData queryCar() { | public ResultData queryCar() { | ||||
| logger.debug("[" + getIpAddr() + "] DataTowerController::queryCar"); | |||||
| Map<String, Object> data = dataTowerService.queryCar(getTenantId()); | Map<String, Object> data = dataTowerService.queryCar(getTenantId()); | ||||
| @@ -64,6 +68,7 @@ public class DataTowerController extends BaseController { | |||||
| @ApiOperation("查询客流") | @ApiOperation("查询客流") | ||||
| @PostMapping("/queryCustomer") | @PostMapping("/queryCustomer") | ||||
| public ResultData queryCustomer() { | public ResultData queryCustomer() { | ||||
| logger.debug("[" + getIpAddr() + "] DataTowerController::queryCustomer"); | |||||
| Map<String, Object> data = dataTowerService.queryCustomer(getTenantId()); | Map<String, Object> data = dataTowerService.queryCustomer(getTenantId()); | ||||
| @@ -12,6 +12,7 @@ import com.iformall.exception.MallinkException; | |||||
| import com.iformall.service.MallRolePermissionService; | import com.iformall.service.MallRolePermissionService; | ||||
| import com.iformall.service.MallUserRoleService; | import com.iformall.service.MallUserRoleService; | ||||
| import com.iformall.shiro.UserSession; | import com.iformall.shiro.UserSession; | ||||
| import com.iformall.utils.IPUtil; | |||||
| import com.iformall.utils.ShiroUtils; | import com.iformall.utils.ShiroUtils; | ||||
| import io.swagger.annotations.Api; | import io.swagger.annotations.Api; | ||||
| import io.swagger.annotations.ApiOperation; | import io.swagger.annotations.ApiOperation; | ||||
| @@ -25,10 +26,13 @@ import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.beans.factory.annotation.Value; | import org.springframework.beans.factory.annotation.Value; | ||||
| import org.springframework.util.StringUtils; | import org.springframework.util.StringUtils; | ||||
| import org.springframework.web.bind.annotation.*; | import org.springframework.web.bind.annotation.*; | ||||
| import org.springframework.web.context.request.RequestContextHolder; | |||||
| import org.springframework.web.context.request.ServletRequestAttributes; | |||||
| import javax.imageio.ImageIO; | import javax.imageio.ImageIO; | ||||
| import javax.servlet.ServletException; | import javax.servlet.ServletException; | ||||
| import javax.servlet.ServletOutputStream; | import javax.servlet.ServletOutputStream; | ||||
| import javax.servlet.http.HttpServletRequest; | |||||
| import javax.servlet.http.HttpServletResponse; | import javax.servlet.http.HttpServletResponse; | ||||
| import java.awt.image.BufferedImage; | import java.awt.image.BufferedImage; | ||||
| import java.io.IOException; | import java.io.IOException; | ||||
| @@ -36,7 +40,7 @@ import java.io.IOException; | |||||
| @RestController | @RestController | ||||
| @Api(description = "登录相关接口") | @Api(description = "登录相关接口") | ||||
| public class HomeController { | |||||
| public class HomeController extends BaseController { | |||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | private final Logger logger = LoggerFactory.getLogger(this.getClass()); | ||||
| @Value("${version}") | @Value("${version}") | ||||
| @@ -53,6 +57,7 @@ public class HomeController { | |||||
| @GetMapping("/captcha.jpg") | @GetMapping("/captcha.jpg") | ||||
| public void captcha(HttpServletResponse response)throws ServletException, IOException { | public void captcha(HttpServletResponse response)throws ServletException, IOException { | ||||
| logger.debug("[" + getIpAddr() + "] HomeController::captcha"); | |||||
| response.setHeader("Cache-Control", "no-store, no-cache"); | response.setHeader("Cache-Control", "no-store, no-cache"); | ||||
| response.setContentType("image/jpeg"); | response.setContentType("image/jpeg"); | ||||
| @@ -71,6 +76,7 @@ public class HomeController { | |||||
| @ApiOperation("登录") | @ApiOperation("登录") | ||||
| @PostMapping("/doLogin") | @PostMapping("/doLogin") | ||||
| public ResultData login(@RequestBody MallUserInfo user) { | public ResultData login(@RequestBody MallUserInfo user) { | ||||
| logger.debug("[" + getIpAddr() + "] HomeController::login"); | |||||
| try { | try { | ||||
| String kaptcha = ShiroUtils.getKaptcha(Constants.KAPTCHA_SESSION_KEY); | String kaptcha = ShiroUtils.getKaptcha(Constants.KAPTCHA_SESSION_KEY); | ||||
| if(!user.getCaptcha().equalsIgnoreCase(kaptcha)){ | if(!user.getCaptcha().equalsIgnoreCase(kaptcha)){ | ||||
| @@ -129,6 +135,7 @@ public class HomeController { | |||||
| @ApiOperation("B端登录") | @ApiOperation("B端登录") | ||||
| @PostMapping("/bHidLogin") | @PostMapping("/bHidLogin") | ||||
| public ResultData bLogin(@RequestBody MallUserInfo user) { | public ResultData bLogin(@RequestBody MallUserInfo user) { | ||||
| logger.debug("[" + getIpAddr() + "] HomeController::bHidLogin"); | |||||
| 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); | ||||
| @@ -175,7 +182,8 @@ public class HomeController { | |||||
| @ApiOperation("登出") | @ApiOperation("登出") | ||||
| @GetMapping("/logout") | @GetMapping("/logout") | ||||
| public ResultData login() { | |||||
| public ResultData logout() { | |||||
| logger.debug("[" + getIpAddr() + "] HomeController::logout"); | |||||
| ResultData data = new ResultData(); | ResultData data = new ResultData(); | ||||
| SecurityUtils.getSubject().logout(); | SecurityUtils.getSubject().logout(); | ||||
| return data; | return data; | ||||
| @@ -184,6 +192,7 @@ public class HomeController { | |||||
| @ApiOperation("获取后端版本号") | @ApiOperation("获取后端版本号") | ||||
| @GetMapping("/version") | @GetMapping("/version") | ||||
| public ResultData version() { | public ResultData version() { | ||||
| logger.debug("[" + getIpAddr() + "] HomeController::version"); | |||||
| return new ResultData(version); | return new ResultData(version); | ||||
| } | } | ||||
| } | } | ||||
| @@ -20,7 +20,7 @@ import org.springframework.web.bind.annotation.RestController; | |||||
| */ | */ | ||||
| @RestController | @RestController | ||||
| @RequestMapping("permission") | @RequestMapping("permission") | ||||
| public class MallPermissionController { | |||||
| public class MallPermissionController extends BaseController { | |||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | private final Logger logger = LoggerFactory.getLogger(this.getClass()); | ||||
| @Autowired | @Autowired | ||||
| @@ -29,6 +29,7 @@ public class MallPermissionController { | |||||
| @GetMapping("alllist") | @GetMapping("alllist") | ||||
| public ResultData alllist(String ava) { | public ResultData alllist(String ava) { | ||||
| logger.debug("[" + getIpAddr() + "] MallPermissionController::alllist"); | |||||
| MallPermission record = new MallPermission(); | MallPermission record = new MallPermission(); | ||||
| record.setAvailable(ava); | record.setAvailable(ava); | ||||
| PageInfo<MallPermission> permissions = mallPermissionService.listAsPage(record, 1, 10000); | PageInfo<MallPermission> permissions = mallPermissionService.listAsPage(record, 1, 10000); | ||||
| @@ -37,6 +38,7 @@ public class MallPermissionController { | |||||
| @PostMapping("add") | @PostMapping("add") | ||||
| public ResultData createPermission(MallPermission mallPermission) { | public ResultData createPermission(MallPermission mallPermission) { | ||||
| logger.debug("[" + getIpAddr() + "] MallPermissionController::createPermission"); | |||||
| Assert.notNull(mallPermission.getName(), "用户名不能为空"); | Assert.notNull(mallPermission.getName(), "用户名不能为空"); | ||||
| mallPermissionService.saveOrUpdate(mallPermission); | mallPermissionService.saveOrUpdate(mallPermission); | ||||
| return new ResultData(mallPermission.getId()); | return new ResultData(mallPermission.getId()); | ||||
| @@ -44,18 +46,21 @@ public class MallPermissionController { | |||||
| @PostMapping("update") | @PostMapping("update") | ||||
| public ResultData updatePermission(MallPermission sysPermission) { | public ResultData updatePermission(MallPermission sysPermission) { | ||||
| logger.debug("[" + getIpAddr() + "] MallPermissionController::updatePermission"); | |||||
| mallPermissionService.saveOrUpdate(sysPermission); | mallPermissionService.saveOrUpdate(sysPermission); | ||||
| return new ResultData(); | return new ResultData(); | ||||
| } | } | ||||
| @GetMapping("/del") | @GetMapping("/del") | ||||
| public ResultData delete(Long id) { | public ResultData delete(Long id) { | ||||
| logger.debug("[" + getIpAddr() + "] MallPermissionController::delete"); | |||||
| 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) { | ||||
| logger.debug("[" + getIpAddr() + "] MallPermissionController::findById"); | |||||
| mallPermissionService.getById(id); | mallPermissionService.getById(id); | ||||
| return new ResultData(Result.SUCCESS, "成功", null); | return new ResultData(Result.SUCCESS, "成功", null); | ||||
| } | } | ||||
| @@ -46,6 +46,7 @@ public class MallRoleController extends BaseController { | |||||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", 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 = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | ||||
| public ResultData list(MallRole sysRole, Integer pageNum, Integer pageSize) { | public ResultData list(MallRole sysRole, Integer pageNum, Integer pageSize) { | ||||
| logger.debug("[" + getIpAddr() + "] MallRoleController::list"); | |||||
| String tenantId = getTenantId(); | String tenantId = getTenantId(); | ||||
| sysRole.setTenantId(tenantId); | sysRole.setTenantId(tenantId); | ||||
| final PageInfo<MallRole> page = sysRoleService.listAsPage(sysRole, pageNum, pageSize); | final PageInfo<MallRole> page = sysRoleService.listAsPage(sysRole, pageNum, pageSize); | ||||
| @@ -69,6 +70,7 @@ public class MallRoleController extends BaseController { | |||||
| @PostMapping("saveOrUpdate") | @PostMapping("saveOrUpdate") | ||||
| public ResultData saveOrUpdate(@RequestBody MallRole sysRole) { | public ResultData saveOrUpdate(@RequestBody MallRole sysRole) { | ||||
| logger.debug("[" + getIpAddr() + "] MallRoleController::saveOrUpdate"); | |||||
| MallUserInfo currentUser = getUser(); | MallUserInfo currentUser = getUser(); | ||||
| if(currentUser.getIsAdmin().equals(EnumUserAdmin.Normal.getCode())) { | if(currentUser.getIsAdmin().equals(EnumUserAdmin.Normal.getCode())) { | ||||
| return new ResultData(ErrorCode.USER_NOT_ADMIN.getCode(), "只有超级管理员才能保存角色"); | return new ResultData(ErrorCode.USER_NOT_ADMIN.getCode(), "只有超级管理员才能保存角色"); | ||||
| @@ -94,6 +96,7 @@ public class MallRoleController extends BaseController { | |||||
| @PostMapping("add") | @PostMapping("add") | ||||
| public ResultData add(MallRole sysRole) { | public ResultData add(MallRole sysRole) { | ||||
| logger.debug("[" + getIpAddr() + "] MallRoleController::add"); | |||||
| MallUserInfo currentUser = getUser(); | MallUserInfo currentUser = getUser(); | ||||
| if(currentUser.getIsAdmin().equals(EnumUserAdmin.Normal.getCode())) { | if(currentUser.getIsAdmin().equals(EnumUserAdmin.Normal.getCode())) { | ||||
| return new ResultData(ErrorCode.USER_NOT_ADMIN.getCode(), "只有超级管理员才能添加角色"); | return new ResultData(ErrorCode.USER_NOT_ADMIN.getCode(), "只有超级管理员才能添加角色"); | ||||
| @@ -106,6 +109,7 @@ public class MallRoleController extends BaseController { | |||||
| @PostMapping("update") | @PostMapping("update") | ||||
| public ResultData update(MallRole sysRole) { | public ResultData update(MallRole sysRole) { | ||||
| logger.debug("[" + getIpAddr() + "] MallRoleController::update"); | |||||
| MallUserInfo currentUser = getUser(); | MallUserInfo currentUser = getUser(); | ||||
| if(currentUser.getIsAdmin().equals(EnumUserAdmin.Normal.getCode())) { | if(currentUser.getIsAdmin().equals(EnumUserAdmin.Normal.getCode())) { | ||||
| return new ResultData(ErrorCode.USER_NOT_ADMIN.getCode(), "只有超级管理员才能更新角色"); | return new ResultData(ErrorCode.USER_NOT_ADMIN.getCode(), "只有超级管理员才能更新角色"); | ||||
| @@ -121,6 +125,7 @@ public class MallRoleController extends BaseController { | |||||
| @PostMapping("/del") | @PostMapping("/del") | ||||
| public ResultData delete(@RequestBody MallRole sysRole) { | public ResultData delete(@RequestBody MallRole sysRole) { | ||||
| logger.debug("[" + getIpAddr() + "] MallRoleController::delete"); | |||||
| MallUserInfo currentUser = getUser(); | MallUserInfo currentUser = getUser(); | ||||
| if(currentUser.getIsAdmin().equals(EnumUserAdmin.Normal.getCode())) { | if(currentUser.getIsAdmin().equals(EnumUserAdmin.Normal.getCode())) { | ||||
| return new ResultData(ErrorCode.USER_NOT_ADMIN.getCode(), "只有超级管理员才能删除角色"); | return new ResultData(ErrorCode.USER_NOT_ADMIN.getCode(), "只有超级管理员才能删除角色"); | ||||
| @@ -63,6 +63,7 @@ public class MallUserInfoController extends BaseController { | |||||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", 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 = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | ||||
| public ResultData listAsPage(MallUserInfo userInfo, Integer pageNum, Integer pageSize) { | public ResultData listAsPage(MallUserInfo userInfo, Integer pageNum, Integer pageSize) { | ||||
| logger.debug("[" + getIpAddr() + "] MallUserInfoController::listAsPage"); | |||||
| userInfo.setTenantId(getTenantId()); | userInfo.setTenantId(getTenantId()); | ||||
| userInfo.setSortColumns(MallUserInfo.Field.Id_DESC); | userInfo.setSortColumns(MallUserInfo.Field.Id_DESC); | ||||
| final PageInfo<MallUserInfo> page = userInfoService.listAsPage(userInfo, pageNum, pageSize); | final PageInfo<MallUserInfo> page = userInfoService.listAsPage(userInfo, pageNum, pageSize); | ||||
| @@ -85,6 +86,7 @@ public class MallUserInfoController extends BaseController { | |||||
| @ApiOperation(value = "用户详情接口", response = String.class) | @ApiOperation(value = "用户详情接口", response = String.class) | ||||
| @GetMapping("detail") | @GetMapping("detail") | ||||
| public ResultData detail(Long id) { | public ResultData detail(Long id) { | ||||
| logger.debug("[" + getIpAddr() + "] MallUserInfoController::detail"); | |||||
| final MallUserInfo user = userInfoService.getById(id); | final MallUserInfo user = userInfoService.getById(id); | ||||
| return new ResultData(user); | return new ResultData(user); | ||||
| } | } | ||||
| @@ -92,6 +94,7 @@ public class MallUserInfoController extends BaseController { | |||||
| @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) { | ||||
| logger.debug("[" + getIpAddr() + "] MallUserInfoController::createUser"); | |||||
| MallUserInfo currentUser = getUser(); | MallUserInfo currentUser = getUser(); | ||||
| if(currentUser.getIsAdmin().equals(EnumUserAdmin.Normal.getCode())) { | if(currentUser.getIsAdmin().equals(EnumUserAdmin.Normal.getCode())) { | ||||
| return new ResultData(ErrorCode.USER_NOT_ADMIN.getCode(), "只有超级管理员才能添加用户"); | return new ResultData(ErrorCode.USER_NOT_ADMIN.getCode(), "只有超级管理员才能添加用户"); | ||||
| @@ -122,6 +125,7 @@ public class MallUserInfoController extends BaseController { | |||||
| @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) { | ||||
| logger.debug("[" + getIpAddr() + "] MallUserInfoController::updateUser"); | |||||
| MallUserInfo currentUser = getUser(); | MallUserInfo currentUser = getUser(); | ||||
| // 只有超管和自己能更新信息 | // 只有超管和自己能更新信息 | ||||
| if (!(currentUser.getId().equals(userInfo.getId()) || | if (!(currentUser.getId().equals(userInfo.getId()) || | ||||
| @@ -180,6 +184,7 @@ public class MallUserInfoController extends BaseController { | |||||
| @ApiOperation(value = "删除用户接口", response = String.class) | @ApiOperation(value = "删除用户接口", response = String.class) | ||||
| @PostMapping("/del") | @PostMapping("/del") | ||||
| public ResultData deleteUser(@RequestBody MallUserInfo userInfo) { | public ResultData deleteUser(@RequestBody MallUserInfo userInfo) { | ||||
| logger.debug("[" + getIpAddr() + "] MallUserInfoController::deleteUser"); | |||||
| MallUserInfo currentUser = getUser(); | MallUserInfo currentUser = getUser(); | ||||
| if (currentUser.getIsAdmin().equals(EnumUserAdmin.Normal.getCode())) { | if (currentUser.getIsAdmin().equals(EnumUserAdmin.Normal.getCode())) { | ||||
| return new ResultData(ErrorCode.USER_NOT_ADMIN.getCode(), "只有超级管理员才能删除用户"); | return new ResultData(ErrorCode.USER_NOT_ADMIN.getCode(), "只有超级管理员才能删除用户"); | ||||
| @@ -202,6 +207,7 @@ public class MallUserInfoController extends BaseController { | |||||
| @ApiOperation(value = "起停用户接口", response = String.class) | @ApiOperation(value = "起停用户接口", response = String.class) | ||||
| @GetMapping("status") | @GetMapping("status") | ||||
| public ResultData modifyStatus(Long userId, Integer status) { | public ResultData modifyStatus(Long userId, Integer status) { | ||||
| logger.debug("[" + getIpAddr() + "] MallUserInfoController::modifyStatus"); | |||||
| MallUserInfo currentUser = getUser(); | MallUserInfo currentUser = getUser(); | ||||
| if (currentUser.getIsAdmin().equals(EnumUserAdmin.Normal.getCode())) { | if (currentUser.getIsAdmin().equals(EnumUserAdmin.Normal.getCode())) { | ||||
| return new ResultData(ErrorCode.USER_NOT_ADMIN.getCode(), "只有超级管理员才能删除用户"); | return new ResultData(ErrorCode.USER_NOT_ADMIN.getCode(), "只有超级管理员才能删除用户"); | ||||
| @@ -230,6 +236,7 @@ public class MallUserInfoController extends BaseController { | |||||
| @GetMapping("hasButtonPermission") | @GetMapping("hasButtonPermission") | ||||
| public ResultData hasButtonPermission(String permissions) { | public ResultData hasButtonPermission(String permissions) { | ||||
| logger.debug("[" + getIpAddr() + "] MallUserInfoController::hasButtonPermission"); | |||||
| MallUserInfo info = getUser(); | MallUserInfo info = getUser(); | ||||
| info.setPassword("保密"); | info.setPassword("保密"); | ||||
| Map<String, Boolean> map = new HashMap<>(); | Map<String, Boolean> map = new HashMap<>(); | ||||
| @@ -250,6 +257,7 @@ public class MallUserInfoController extends BaseController { | |||||
| @GetMapping("getUser") | @GetMapping("getUser") | ||||
| public ResultData getUserInfo() { | public ResultData getUserInfo() { | ||||
| logger.debug("[" + getIpAddr() + "] MallUserInfoController::getUserInfo"); | |||||
| MallUserInfo info = getUser(); | MallUserInfo info = getUser(); | ||||
| info.setPassword("保密"); | info.setPassword("保密"); | ||||
| if (info.getIsAdmin().equals(EnumUserAdmin.ADMIN.getCode())) { // isAdmin | if (info.getIsAdmin().equals(EnumUserAdmin.ADMIN.getCode())) { // isAdmin | ||||
| @@ -291,7 +299,7 @@ public class MallUserInfoController extends BaseController { | |||||
| @ApiImplicitParam(name = "userName", value = "手机号", dataType = "String", paramType = "query", required = true), | @ApiImplicitParam(name = "userName", value = "手机号", dataType = "String", paramType = "query", required = true), | ||||
| @ApiImplicitParam(name = "type", value = "场景(1:登录)", dataType = "Integer", paramType = "query", required = true)}) | @ApiImplicitParam(name = "type", value = "场景(1:登录)", dataType = "Integer", paramType = "query", required = true)}) | ||||
| public ResultData sendvalidationcode(String userName, Integer type) { | public ResultData sendvalidationcode(String userName, Integer type) { | ||||
| logger.debug("[" + getIpAddr() + "] MallUserInfoController::sendvalidationcode"); | |||||
| MallUserInfo userQ = new MallUserInfo(); | MallUserInfo userQ = new MallUserInfo(); | ||||
| userQ.setUsername(userName); | userQ.setUsername(userName); | ||||
| @@ -321,6 +329,7 @@ public class MallUserInfoController extends BaseController { | |||||
| @ApiOperation(value = "修改密码", notes = "{\"userName\",\"string\",\"code\",\"string\",\"pwd\",\"string\"}") | @ApiOperation(value = "修改密码", notes = "{\"userName\",\"string\",\"code\",\"string\",\"pwd\",\"string\"}") | ||||
| @PostMapping("/updatepwd") | @PostMapping("/updatepwd") | ||||
| public ResultData updatepwd(@RequestBody Map<String, String> params) { | public ResultData updatepwd(@RequestBody Map<String, String> params) { | ||||
| logger.debug("[" + getIpAddr() + "] MallUserInfoController::updatepwd"); | |||||
| // String phone,String code,String pwd | // String phone,String code,String pwd | ||||
| String userName = params.get("userName"); | String userName = params.get("userName"); | ||||
| String code = params.get("code"); | String code = params.get("code"); | ||||
| @@ -30,6 +30,7 @@ public class MarkingDataReportController extends BaseController { | |||||
| @ApiOperation("查询券数据") | @ApiOperation("查询券数据") | ||||
| @GetMapping("/couponData") | @GetMapping("/couponData") | ||||
| public ResultData findCouponData() { | public ResultData findCouponData() { | ||||
| logger.debug("[" + getIpAddr() + "] MarkingDataReportController::findCouponData"); | |||||
| return new ResultData(markingDataReportService.getCouponData(getTenantId())); | return new ResultData(markingDataReportService.getCouponData(getTenantId())); | ||||
| } | } | ||||
| @@ -39,12 +40,14 @@ public class MarkingDataReportController extends BaseController { | |||||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", 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 = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | ||||
| public ResultData findCouponDataList(@ModelAttribute MarkingCouponDataReportDto markingCouponDataReportDto, Integer pageNum, Integer pageSize) { | public ResultData findCouponDataList(@ModelAttribute MarkingCouponDataReportDto markingCouponDataReportDto, Integer pageNum, Integer pageSize) { | ||||
| logger.debug("[" + getIpAddr() + "] MarkingDataReportController::findCouponDataList"); | |||||
| return new ResultData(markingDataReportService.getCouponDataList(getTenantId(), markingCouponDataReportDto, pageNum, pageSize)); | return new ResultData(markingDataReportService.getCouponDataList(getTenantId(), markingCouponDataReportDto, pageNum, pageSize)); | ||||
| } | } | ||||
| @ApiOperation("查询场景投放券数据") | @ApiOperation("查询场景投放券数据") | ||||
| @GetMapping("/sceneData") | @GetMapping("/sceneData") | ||||
| public ResultData findSceneData() { | public ResultData findSceneData() { | ||||
| logger.debug("[" + getIpAddr() + "] MarkingDataReportController::findSceneData"); | |||||
| return new ResultData(markingDataReportService.getSceneData(getTenantId())); | return new ResultData(markingDataReportService.getSceneData(getTenantId())); | ||||
| } | } | ||||
| @@ -54,12 +57,14 @@ public class MarkingDataReportController extends BaseController { | |||||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", 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 = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | ||||
| public ResultData findSceneDataList(@ModelAttribute MarkingCouponDataReportDto markingCouponDataReportDto, Integer pageNum, Integer pageSize) { | public ResultData findSceneDataList(@ModelAttribute MarkingCouponDataReportDto markingCouponDataReportDto, Integer pageNum, Integer pageSize) { | ||||
| logger.debug("[" + getIpAddr() + "] MarkingDataReportController::findSceneDataList"); | |||||
| return new ResultData(markingDataReportService.getSceneDataList(getTenantId(), markingCouponDataReportDto, pageNum, pageSize)); | return new ResultData(markingDataReportService.getSceneDataList(getTenantId(), markingCouponDataReportDto, pageNum, pageSize)); | ||||
| } | } | ||||
| @ApiOperation("查询触达用户数数据") | @ApiOperation("查询触达用户数数据") | ||||
| @GetMapping("/touchUsersData") | @GetMapping("/touchUsersData") | ||||
| public ResultData touchUsersData() { | public ResultData touchUsersData() { | ||||
| logger.debug("[" + getIpAddr() + "] MarkingDataReportController::touchUsersData"); | |||||
| return new ResultData(markingDataReportService.getTouchUsersReportData(getTenantId())); | return new ResultData(markingDataReportService.getTouchUsersReportData(getTenantId())); | ||||
| } | } | ||||
| @@ -69,6 +74,7 @@ public class MarkingDataReportController extends BaseController { | |||||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", 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 = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | ||||
| public ResultData touchUsersDataList(@ModelAttribute MarkingCouponDataReportDto markingCouponDataReportDto, Integer pageNum, Integer pageSize) { | public ResultData touchUsersDataList(@ModelAttribute MarkingCouponDataReportDto markingCouponDataReportDto, Integer pageNum, Integer pageSize) { | ||||
| logger.debug("[" + getIpAddr() + "] MarkingDataReportController::touchUsersDataList"); | |||||
| return new ResultData(markingDataReportService.getTouchUsersReportList(getTenantId(), markingCouponDataReportDto, pageNum, pageSize)); | return new ResultData(markingDataReportService.getTouchUsersReportList(getTenantId(), markingCouponDataReportDto, pageNum, pageSize)); | ||||
| } | } | ||||
| @@ -22,6 +22,7 @@ public class PushLimitController extends BaseController { | |||||
| @ApiOperation("疲劳度配置") | @ApiOperation("疲劳度配置") | ||||
| @GetMapping("setting") | @GetMapping("setting") | ||||
| public ResultData list() { | public ResultData list() { | ||||
| logger.debug("[" + getIpAddr() + "] PushLimitController::list"); | |||||
| PushLimit pushLimit = pushLimitService.getPushLimit(getTenantId()); | PushLimit pushLimit = pushLimitService.getPushLimit(getTenantId()); | ||||
| return new ResultData(pushLimit); | return new ResultData(pushLimit); | ||||
| } | } | ||||
| @@ -29,6 +30,7 @@ public class PushLimitController extends BaseController { | |||||
| @ApiOperation("根据id更新接口") | @ApiOperation("根据id更新接口") | ||||
| @PostMapping("update") | @PostMapping("update") | ||||
| public ResultData update(@RequestBody PushLimit pushLimit) { | public ResultData update(@RequestBody PushLimit pushLimit) { | ||||
| logger.debug("[" + getIpAddr() + "] PushLimitController::update"); | |||||
| pushLimit.setTenantId(getTenantId()); | pushLimit.setTenantId(getTenantId()); | ||||
| pushLimitService.saveOrUpdate(pushLimit); | pushLimitService.saveOrUpdate(pushLimit); | ||||
| return new ResultData(); | return new ResultData(); | ||||
| @@ -114,6 +114,7 @@ public class UploadController extends BaseController { | |||||
| @PostMapping(value = "/awsFileUpload", consumes = "multipart/*", headers = "content-type=multipart/form-data") | @PostMapping(value = "/awsFileUpload", consumes = "multipart/*", headers = "content-type=multipart/form-data") | ||||
| @ApiOperation("上传文件") | @ApiOperation("上传文件") | ||||
| public ResultData awsfileUpload(@RequestParam("file") MultipartFile multiReq) { | public ResultData awsfileUpload(@RequestParam("file") MultipartFile multiReq) { | ||||
| logger.debug("[" + getIpAddr() + "] UploadController::awsfileUpload"); | |||||
| ResultData data = new ResultData(); | ResultData data = new ResultData(); | ||||
| @@ -27,6 +27,7 @@ public class WxAdminLogController extends BaseController { | |||||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", 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 = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | ||||
| public ResultData list(@ModelAttribute WxAdminLog wxAdminLog, Integer pageNum, Integer pageSize) { | public ResultData list(@ModelAttribute WxAdminLog wxAdminLog, Integer pageNum, Integer pageSize) { | ||||
| logger.debug("[" + getIpAddr() + "] WxAdminLogController::list"); | |||||
| if (null == wxAdminLog) wxAdminLog = new WxAdminLog(); | 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); | ||||
| @@ -35,6 +36,7 @@ public class WxAdminLogController extends BaseController { | |||||
| @ApiOperation("新增接口") | @ApiOperation("新增接口") | ||||
| @PostMapping("add") | @PostMapping("add") | ||||
| public ResultData add(@RequestBody WxAdminLog wxAdminLog) { | public ResultData add(@RequestBody WxAdminLog wxAdminLog) { | ||||
| logger.debug("[" + getIpAddr() + "] WxAdminLogController::add"); | |||||
| //Assert.notNull(wxAdminLog.getName(), "角色名不能为空"); | //Assert.notNull(wxAdminLog.getName(), "角色名不能为空"); | ||||
| //Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名"); | //Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名"); | ||||
| wxAdminLogService.saveOrUpdate(wxAdminLog); | wxAdminLogService.saveOrUpdate(wxAdminLog); | ||||
| @@ -44,6 +46,7 @@ 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) { | ||||
| logger.debug("[" + getIpAddr() + "] WxAdminLogController::update"); | |||||
| String tenantId = getTenantId(); | String tenantId = getTenantId(); | ||||
| wxAdminLog.setTenantId(tenantId); | wxAdminLog.setTenantId(tenantId); | ||||
| wxAdminLogService.saveOrUpdate(wxAdminLog); | wxAdminLogService.saveOrUpdate(wxAdminLog); | ||||
| @@ -54,6 +57,7 @@ public class WxAdminLogController extends BaseController { | |||||
| @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) { | ||||
| logger.debug("[" + getIpAddr() + "] WxAdminLogController::delete"); | |||||
| wxAdminLogService.deleteById(id); | wxAdminLogService.deleteById(id); | ||||
| return new ResultData(Result.SUCCESS, "删除成功", null); | return new ResultData(Result.SUCCESS, "删除成功", null); | ||||
| } | } | ||||
| @@ -62,12 +66,14 @@ public class WxAdminLogController extends BaseController { | |||||
| @GetMapping("/findById") | @GetMapping("/findById") | ||||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | ||||
| public ResultData findById(Long id) { | public ResultData findById(Long id) { | ||||
| logger.debug("[" + getIpAddr() + "] WxAdminLogController::findById"); | |||||
| return new ResultData(Result.SUCCESS, "查询成功", wxAdminLogService.getById(id)); | return new ResultData(Result.SUCCESS, "查询成功", wxAdminLogService.getById(id)); | ||||
| } | } | ||||
| @ApiOperation("PV计数") | @ApiOperation("PV计数") | ||||
| @PostMapping("pvlog") | @PostMapping("pvlog") | ||||
| public ResultData pvLog(@RequestBody WxAdminLog wxAdminLog) { | public ResultData pvLog(@RequestBody WxAdminLog wxAdminLog) { | ||||
| logger.debug("[" + getIpAddr() + "] WxAdminLogController::pvLog"); | |||||
| String tenantId = getTenantId(); | String tenantId = getTenantId(); | ||||
| wxAdminLog.setTenantId(tenantId); | wxAdminLog.setTenantId(tenantId); | ||||
| wxAdminLogService.saveLogCount(wxAdminLog); | wxAdminLogService.saveLogCount(wxAdminLog); | ||||
| @@ -33,6 +33,7 @@ public class WxAppinfoController extends BaseController { | |||||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", 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 = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | ||||
| public ResultData list(@ModelAttribute WxAppinfo wxAppinfo, Integer pageNum, Integer pageSize) { | public ResultData list(@ModelAttribute WxAppinfo wxAppinfo, Integer pageNum, Integer pageSize) { | ||||
| logger.debug("[" + getIpAddr() + "] WxAppinfoController::list"); | |||||
| if (null == wxAppinfo) wxAppinfo = new WxAppinfo(); | 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); | ||||
| @@ -41,6 +42,7 @@ public class WxAppinfoController extends BaseController { | |||||
| @ApiOperation("新增接口") | @ApiOperation("新增接口") | ||||
| @PostMapping("add") | @PostMapping("add") | ||||
| public ResultData add(@RequestBody WxAppinfo wxAppinfo) { | public ResultData add(@RequestBody WxAppinfo wxAppinfo) { | ||||
| logger.debug("[" + getIpAddr() + "] WxAppinfoController::add"); | |||||
| //Assert.notNull(wxAppinfo.getName(), "角色名不能为空"); | //Assert.notNull(wxAppinfo.getName(), "角色名不能为空"); | ||||
| //Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名"); | //Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名"); | ||||
| wxAppinfoService.saveOrUpdate(wxAppinfo); | wxAppinfoService.saveOrUpdate(wxAppinfo); | ||||
| @@ -50,6 +52,7 @@ public class WxAppinfoController extends BaseController { | |||||
| @ApiOperation("根据id更新接口") | @ApiOperation("根据id更新接口") | ||||
| @PostMapping("update") | @PostMapping("update") | ||||
| public ResultData update(@RequestBody WxAppinfo wxAppinfo) { | public ResultData update(@RequestBody WxAppinfo wxAppinfo) { | ||||
| logger.debug("[" + getIpAddr() + "] WxAppinfoController::update"); | |||||
| wxAppinfoService.saveOrUpdate(wxAppinfo); | wxAppinfoService.saveOrUpdate(wxAppinfo); | ||||
| return new ResultData(); | return new ResultData(); | ||||
| } | } | ||||
| @@ -58,6 +61,7 @@ public class WxAppinfoController extends BaseController { | |||||
| @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) { | ||||
| logger.debug("[" + getIpAddr() + "] WxAppinfoController::delete"); | |||||
| wxAppinfoService.deleteById(id); | wxAppinfoService.deleteById(id); | ||||
| return new ResultData(Result.SUCCESS, "删除成功", null); | return new ResultData(Result.SUCCESS, "删除成功", null); | ||||
| } | } | ||||
| @@ -66,6 +70,7 @@ public class WxAppinfoController extends BaseController { | |||||
| @GetMapping("/findById") | @GetMapping("/findById") | ||||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | ||||
| public ResultData findById(Long id) { | public ResultData findById(Long id) { | ||||
| logger.debug("[" + getIpAddr() + "] WxAppinfoController::findById"); | |||||
| return new ResultData(Result.SUCCESS, "查询成功", wxAppinfoService.getById(id)); | return new ResultData(Result.SUCCESS, "查询成功", wxAppinfoService.getById(id)); | ||||
| } | } | ||||
| @@ -73,6 +78,7 @@ public class WxAppinfoController extends BaseController { | |||||
| @ApiOperation("更新AccessToken, 无限制二维码生成需要更新token") | @ApiOperation("更新AccessToken, 无限制二维码生成需要更新token") | ||||
| @GetMapping("/accessTokenUpdate") | @GetMapping("/accessTokenUpdate") | ||||
| public ResultData tokenUpdate() { | public ResultData tokenUpdate() { | ||||
| logger.debug("[" + getIpAddr() + "] WxAppinfoController::tokenUpdate"); | |||||
| try { | try { | ||||
| wxAppinfoService.tokenUpdate(getTenantId()); | wxAppinfoService.tokenUpdate(getTenantId()); | ||||
| } catch (Exception e) { | } catch (Exception e) { | ||||
| @@ -85,6 +91,7 @@ public class WxAppinfoController extends BaseController { | |||||
| @ApiOperation(value = "下载二维码", notes = "参数{\"pageUrl\":\"String\", \"sceneParam\":\"二维码参数\", \"type\":0:有限二维码,1:无限二维码,\"withText\":int(0:不带字, 1:加一行字,2:加两行字),\"text1\":\"String\",\"text2\":\"String\"}") | @ApiOperation(value = "下载二维码", notes = "参数{\"pageUrl\":\"String\", \"sceneParam\":\"二维码参数\", \"type\":0:有限二维码,1:无限二维码,\"withText\":int(0:不带字, 1:加一行字,2:加两行字),\"text1\":\"String\",\"text2\":\"String\"}") | ||||
| @PostMapping("/downQrCode") | @PostMapping("/downQrCode") | ||||
| public ResultData downQrCode(HttpServletRequest request, HttpServletResponse response, @RequestBody Map<String, Object> params) { | public ResultData downQrCode(HttpServletRequest request, HttpServletResponse response, @RequestBody Map<String, Object> params) { | ||||
| logger.debug("[" + getIpAddr() + "] WxAppinfoController::downQrCode"); | |||||
| String pageUrl = (String) params.get("pageUrl"); | String pageUrl = (String) params.get("pageUrl"); | ||||
| String sceneParam = (String) params.get("sceneParam"); | String sceneParam = (String) params.get("sceneParam"); | ||||
| int type = 0; | int type = 0; | ||||
| @@ -34,6 +34,7 @@ public class WxBillAllController extends BaseController | |||||
| @ApiImplicitParam(name="pageNum",value="页数",dataType="int", 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="pageSize",value="每页条数",dataType="int", paramType = "query",required=true)}) | ||||
| public ResultData list(@ModelAttribute WxBillAll wxBillAll, Integer pageNum, Integer pageSize) { | public ResultData list(@ModelAttribute WxBillAll wxBillAll, Integer pageNum, Integer pageSize) { | ||||
| logger.debug("[" + getIpAddr() + "] WxBillAllController::list"); | |||||
| if (null == wxBillAll){ | if (null == wxBillAll){ | ||||
| wxBillAll = new WxBillAll(); | wxBillAll = new WxBillAll(); | ||||
| } | } | ||||
| @@ -31,6 +31,7 @@ public class WxBillDailyController extends BaseController | |||||
| @ApiImplicitParam(name="pageNum",value="页数",dataType="int", 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="pageSize",value="每页条数",dataType="int", paramType = "query",required=true)}) | ||||
| public ResultData list(@ModelAttribute WxBillDaily wxBillDaily,Integer pageNum, Integer pageSize) { | public ResultData list(@ModelAttribute WxBillDaily wxBillDaily,Integer pageNum, Integer pageSize) { | ||||
| logger.debug("[" + getIpAddr() + "] WxBillDailyController::list"); | |||||
| if (null == wxBillDaily) { | if (null == wxBillDaily) { | ||||
| wxBillDaily = new WxBillDaily(); | wxBillDaily = new WxBillDaily(); | ||||
| } | } | ||||
| @@ -41,18 +42,21 @@ public class WxBillDailyController extends BaseController | |||||
| @PostMapping("add") | @PostMapping("add") | ||||
| public ResultData add(@RequestBody WxBillDaily wxBillDaily) { | public ResultData add(@RequestBody WxBillDaily wxBillDaily) { | ||||
| logger.debug("[" + getIpAddr() + "] WxBillDailyController::add"); | |||||
| wxBillDaily.setTenantId(getTenantId()); | wxBillDaily.setTenantId(getTenantId()); | ||||
| return wxBillDailyService.saveOrUpdate(wxBillDaily); | return wxBillDailyService.saveOrUpdate(wxBillDaily); | ||||
| } | } | ||||
| @PostMapping("update") | @PostMapping("update") | ||||
| public ResultData update(@RequestBody WxBillDaily wxBillDaily) { | public ResultData update(@RequestBody WxBillDaily wxBillDaily) { | ||||
| logger.debug("[" + getIpAddr() + "] WxBillDailyController::update"); | |||||
| return wxBillDailyService.saveOrUpdate(wxBillDaily); | return wxBillDailyService.saveOrUpdate(wxBillDaily); | ||||
| } | } | ||||
| @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) { | ||||
| logger.debug("[" + getIpAddr() + "] WxBillDailyController::delete"); | |||||
| wxBillDailyService.deleteById(id); | wxBillDailyService.deleteById(id); | ||||
| return new ResultData(Result.SUCCESS, "删除成功", null); | return new ResultData(Result.SUCCESS, "删除成功", null); | ||||
| } | } | ||||
| @@ -60,12 +64,14 @@ public class WxBillDailyController extends BaseController | |||||
| @GetMapping("/findById") | @GetMapping("/findById") | ||||
| @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | @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,"查询成功",wxBillDailyService.getById(id)); | |||||
| logger.debug("[" + getIpAddr() + "] WxBillDailyController::findById"); | |||||
| return new ResultData(Result.SUCCESS,"查询成功",wxBillDailyService.getById(id)); | |||||
| } | } | ||||
| @GetMapping("/updatePaid") | @GetMapping("/updatePaid") | ||||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | ||||
| public ResultData updatePaid(Long id) { | public ResultData updatePaid(Long id) { | ||||
| logger.debug("[" + getIpAddr() + "] WxBillDailyController::updatePaid"); | |||||
| return wxBillDailyService.updatePaid(id); | return wxBillDailyService.updatePaid(id); | ||||
| } | } | ||||