| @@ -0,0 +1,37 @@ | |||
| package com.simple.controller; | |||
| import com.simple.common.ResultData; | |||
| import com.simple.service.DataTowerService; | |||
| import io.swagger.annotations.Api; | |||
| import io.swagger.annotations.ApiOperation; | |||
| import org.apache.log4j.Logger; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.web.bind.annotation.PostMapping; | |||
| import org.springframework.web.bind.annotation.RequestMapping; | |||
| import org.springframework.web.bind.annotation.RestController; | |||
| import java.util.Map; | |||
| @Api(description = "数据塔台") | |||
| @RestController | |||
| @RequestMapping("datatower") | |||
| public class DataTowerController extends BaseController { | |||
| private Logger logger = Logger.getLogger(DataTowerController.class); | |||
| @Autowired | |||
| private DataTowerService dataTowerService; | |||
| @ApiOperation("查询运营") | |||
| @PostMapping("/queryRunning") | |||
| public ResultData queryRunning() { | |||
| Map<String,Object> data=dataTowerService.queryRunning(getTenantId()); | |||
| return new ResultData(data); | |||
| } | |||
| } | |||
| @@ -1,12 +1,8 @@ | |||
| package com.simple.controller; | |||
| import java.util.List; | |||
| import java.util.stream.Collectors; | |||
| import org.apache.shiro.SecurityUtils; | |||
| import org.apache.shiro.authc.UsernamePasswordToken; | |||
| import org.apache.shiro.subject.Subject; | |||
| import org.omg.CORBA.SystemException; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.util.StringUtils; | |||
| import org.springframework.web.bind.annotation.GetMapping; | |||
| @@ -14,14 +10,13 @@ import org.springframework.web.bind.annotation.PostMapping; | |||
| import org.springframework.web.bind.annotation.RequestBody; | |||
| import org.springframework.web.bind.annotation.RestController; | |||
| import com.simple.common.ErrorCode; | |||
| import com.simple.common.Result; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.simple.common.ResultData; | |||
| import com.simple.domain.po.MallPermission; | |||
| import com.simple.domain.po.MallRole; | |||
| import com.simple.domain.po.MallRolePermission; | |||
| import com.simple.domain.po.MallUserInfo; | |||
| import com.simple.service.MallPermissionService; | |||
| import com.simple.service.MallRoleService; | |||
| import com.simple.domain.po.MallUserRole; | |||
| import com.simple.service.MallRolePermissionService; | |||
| import com.simple.service.MallUserRoleService; | |||
| import com.simple.shiro.UserSession; | |||
| import io.swagger.annotations.Api; | |||
| @@ -32,11 +27,17 @@ import io.swagger.annotations.ApiOperation; | |||
| @Api(description="登录相关接口") | |||
| public class HomeController { | |||
| // @Autowired | |||
| // private MallRoleService sysRoleService; | |||
| // | |||
| // @Autowired | |||
| // private MallPermissionService sysPermissionService; | |||
| @Autowired | |||
| private MallRoleService sysRoleService; | |||
| private MallUserRoleService mallUserRoleService; | |||
| @Autowired | |||
| private MallPermissionService sysPermissionService; | |||
| private MallRolePermissionService mallRolePermissionService; | |||
| // @GetMapping("login") | |||
| // public ResultData login() { | |||
| @@ -55,16 +56,34 @@ public class HomeController { | |||
| Subject subject = SecurityUtils.getSubject(); | |||
| UsernamePasswordToken token = new UsernamePasswordToken(user.getUsername(), user.getPassword()); | |||
| subject.login(token); | |||
| List<MallRole> roleList = sysRoleService.findRoleByUserId(user.getId()); | |||
| if (null != roleList && roleList.size() > 0) { | |||
| List<MallPermission> permissionList = sysPermissionService | |||
| .findPermissionByRoleIds(roleList.stream().map(MallRole::getId).collect(Collectors.toList())); | |||
| user.setRole(roleList); | |||
| user.setPermission(permissionList); | |||
| } | |||
| // List<MallRole> roleList = sysRoleService.findRoleByUserId(user.getId()); | |||
| // if (null != roleList && roleList.size() > 0) { | |||
| // List<MallPermission> permissionList = sysPermissionService | |||
| // .findPermissionByRoleIds(roleList.stream().map(MallRole::getId).collect(Collectors.toList())); | |||
| // user.setRole(roleList); | |||
| // user.setPermission(permissionList); | |||
| // } | |||
| MallUserInfo info =(MallUserInfo) SecurityUtils.getSubject().getSession().getAttribute(UserSession.userInfo); | |||
| info.setPassword("保密"); | |||
| System.out.println("id:"+ SecurityUtils.getSubject().getSession().getId()); | |||
| // System.out.println("id:"+ SecurityUtils.getSubject().getSession().getId()); | |||
| MallUserRole ur = new MallUserRole(); | |||
| ur.setUid(info.getId()); | |||
| 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(p.getRoleId()); | |||
| 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,"用户名或者密码错误"); | |||
| @@ -12,6 +12,7 @@ import com.simple.common.Result; | |||
| import com.simple.common.ResultData; | |||
| import com.simple.domain.po.MallPermission; | |||
| import com.simple.service.MallPermissionService; | |||
| import com.simple.service.MallRolePermissionService; | |||
| /** | |||
| * @author chenkx | |||
| @@ -23,6 +24,7 @@ public class MallPermissionController { | |||
| @Autowired | |||
| MallPermissionService mallPermissionService; | |||
| @GetMapping("alllist") | |||
| public ResultData alllist(String ava) { | |||
| @@ -50,6 +52,12 @@ public class MallPermissionController { | |||
| mallPermissionService.deleteById(id); | |||
| return new ResultData(Result.SUCCESS, "删除成功", null); | |||
| } | |||
| @GetMapping("/findById") | |||
| public ResultData findById(Long id) { | |||
| mallPermissionService.getById(id); | |||
| return new ResultData(Result.SUCCESS, "成功", null); | |||
| } | |||
| } | |||
| @@ -1,40 +1,87 @@ | |||
| package com.simple.controller; | |||
| import com.simple.domain.po.MallRole; | |||
| import com.simple.service.MallRoleService; | |||
| import com.simple.service.MallRolePermissionService; | |||
| import io.swagger.annotations.Api; | |||
| 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.simple.common.Result; | |||
| import com.simple.common.ResultData; | |||
| import com.simple.domain.po.MallRole; | |||
| import com.simple.domain.po.MallRolePermission; | |||
| import com.simple.service.MallRolePermissionService; | |||
| import com.simple.service.MallRoleService; | |||
| import io.swagger.annotations.Api; | |||
| @RestController | |||
| @RequestMapping("role") | |||
| @Api(description="角色相关接口") | |||
| public class MallRoleController { | |||
| public class MallRoleController extends BaseController{ | |||
| @Autowired | |||
| private MallRoleService sysRoleService; | |||
| @Autowired | |||
| private MallRolePermissionService SysRolePermissionService; | |||
| private MallRolePermissionService sysRolePermissionService; | |||
| private Logger logger = Logger.getLogger(MallRoleController.class); | |||
| @GetMapping("list") | |||
| public ResultData list(MallRole sysRole, Integer pageNum, Integer pageSize) { | |||
| String tenantId = getTenantId(); | |||
| sysRole.setTenantId(tenantId); | |||
| 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); | |||
| } | |||
| return new ResultData(page); | |||
| } | |||
| @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); | |||
| // 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(); | |||
| } | |||
| @PostMapping("add") | |||
| public ResultData add(MallRole sysRole) { | |||
| @@ -54,10 +101,13 @@ public class MallRoleController { | |||
| // Assert.notNull(sysRole.getName(), "角色名不能为空"); | |||
| return new ResultData(); | |||
| } | |||
| @GetMapping("/del") | |||
| public ResultData delete(Long id) { | |||
| sysRoleService.deleteById(id); | |||
| @PostMapping("/del") | |||
| public ResultData delete(@RequestBody MallRole sysRole) { | |||
| sysRoleService.deleteById(sysRole.getId()); | |||
| sysRolePermissionService.deleteByRoleId(sysRole.getId()); | |||
| return new ResultData(Result.SUCCESS, "删除成功", null); | |||
| } | |||
| @@ -1,24 +1,23 @@ | |||
| package com.simple.controller; | |||
| import java.util.ArrayList; | |||
| import java.util.HashMap; | |||
| import java.util.List; | |||
| import java.util.Map; | |||
| import com.simple.domain.po.MallUserInfo; | |||
| import com.simple.domain.po.MallUserRole; | |||
| import com.simple.service.MallUserInfoService; | |||
| import com.simple.service.MallUserRoleService; | |||
| 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.simple.common.ResultData; | |||
| import com.simple.domain.po.MallUserInfo; | |||
| import com.simple.domain.po.MallUserRole; | |||
| import com.simple.service.MallUserInfoService; | |||
| import com.simple.service.MallUserRoleService; | |||
| import com.simple.shiro.PasswordHelper; | |||
| import com.simple.shiro.UserSession; | |||
| @@ -44,6 +43,16 @@ public class MallUserInfoController { | |||
| @GetMapping("lists") | |||
| public ResultData listAsPage(MallUserInfo userInfo, Integer pageNum, Integer 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) { | |||
| u.setRoleId(ur.getList().get(0).getRoleId()); | |||
| } | |||
| u.setPassword(null);//不返回密码 | |||
| } | |||
| return new ResultData(page); | |||
| } | |||
| @@ -56,32 +65,47 @@ public class MallUserInfoController { | |||
| @ApiOperation(value = "创建用户接口", response = String.class) | |||
| @PostMapping("add") | |||
| public ResultData createUser(MallUserInfo userInfo){ | |||
| public ResultData createUser(@RequestBody MallUserInfo userInfo){ | |||
| Assert.notNull(userInfo.getUsername(), "用户名不能为空"); | |||
| Assert.isTrue(checkUnique(userInfo.getUsername(), 0), "重复的用户名"); | |||
| Assert.notNull(userInfo.getPassword(), "密码不能为空"); | |||
| PasswordHelper passwordHelper = new PasswordHelper(); | |||
| passwordHelper.encryptPassword(userInfo); | |||
| userInfoService.saveOrUpdate(userInfo); | |||
| if(userInfo.getRoleId()!=null) { | |||
| MallUserRole r = new MallUserRole(); | |||
| r.setRoleId(userInfo.getRoleId()); | |||
| r.setUid(userInfo.getId()); | |||
| userRoleService.saveOrUpdate(r); | |||
| } | |||
| return new ResultData(); | |||
| } | |||
| @ApiOperation(value = "修改用户接口", response = String.class) | |||
| @PostMapping("update") | |||
| public ResultData updateUser(MallUserInfo userInfo){ | |||
| public ResultData updateUser(@RequestBody MallUserInfo userInfo){ | |||
| Assert.notNull(userInfo.getUsername(), "用户名不能为空"); | |||
| Assert.isTrue(checkUnique(userInfo.getUsername(), 1), "重复的用户名"); | |||
| Assert.notNull(userInfo.getPassword(), "密码不能为空"); | |||
| PasswordHelper passwordHelper = new PasswordHelper(); | |||
| passwordHelper.encryptPassword(userInfo); | |||
| // Assert.notNull(userInfo.getPassword(), "密码不能为空"); | |||
| // PasswordHelper passwordHelper = new PasswordHelper(); | |||
| // passwordHelper.encryptPassword(userInfo); | |||
| userInfo.setPassword(null); | |||
| 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); | |||
| } | |||
| return new ResultData(); | |||
| } | |||
| @ApiOperation(value = "删除用户接口", response = String.class) | |||
| @GetMapping("/del") | |||
| public ResultData deleteUser(Long id) { | |||
| userInfoService.deleteById(id); | |||
| @PostMapping("/del") | |||
| public ResultData deleteUser(@RequestBody MallUserInfo userInfo) { | |||
| userInfoService.deleteById(userInfo.getId()); | |||
| return new ResultData(); | |||
| } | |||
| @@ -1,53 +1,43 @@ | |||
| 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.simple.common.Result; | |||
| import com.simple.common.ResultData; | |||
| import com.simple.domain.po.WxWebLog; | |||
| import com.simple.service.WxWebLogService; | |||
| import com.simple.domain.po.PushLimit; | |||
| import com.simple.service.PushLimitService; | |||
| import io.swagger.annotations.ApiImplicitParam; | |||
| import io.swagger.annotations.ApiImplicitParams; | |||
| import io.swagger.annotations.ApiOperation; | |||
| import org.apache.log4j.Logger; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.web.bind.annotation.*; | |||
| @RestController | |||
| @RequestMapping("wxWebLog") | |||
| public class WxWebLogController extends BaseController | |||
| @RequestMapping("pushLimit") | |||
| public class PushLimitController extends BaseController | |||
| { | |||
| @Autowired | |||
| private WxWebLogService wxWebLogService; | |||
| private PushLimitService pushLimitService; | |||
| private Logger logger = Logger.getLogger(WxWebLogController.class); | |||
| private Logger logger = Logger.getLogger(PushLimitController.class); | |||
| @ApiOperation("分页列表接口") | |||
| @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 WxWebLog wxWebLog,Integer pageNum, Integer pageSize) { | |||
| if (null == wxWebLog) wxWebLog = new WxWebLog(); | |||
| final PageInfo<WxWebLog> page = wxWebLogService.listAsPage(wxWebLog, pageNum, pageSize); | |||
| public ResultData list(@ModelAttribute PushLimit pushLimit, Integer pageNum, Integer pageSize) { | |||
| if (null == pushLimit) pushLimit = new PushLimit(); | |||
| final PageInfo<PushLimit> page = pushLimitService.listAsPage(pushLimit, pageNum, pageSize); | |||
| return new ResultData(page); | |||
| } | |||
| @ApiOperation("新增接口") | |||
| @PostMapping("add") | |||
| public ResultData add(@RequestBody WxWebLog wxWebLog) { | |||
| //Assert.notNull(wxWebLog.getName(), "角色名不能为空"); | |||
| //Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名"); | |||
| wxWebLogService.saveOrUpdate(wxWebLog); | |||
| return new ResultData(); | |||
| } | |||
| @ApiOperation("根据id更新接口") | |||
| @PostMapping("update") | |||
| public ResultData update(@RequestBody WxWebLog wxWebLog) { | |||
| wxWebLogService.saveOrUpdate(wxWebLog); | |||
| public ResultData update(@RequestBody PushLimit pushLimit) { | |||
| pushLimitService.saveOrUpdate(pushLimit); | |||
| return new ResultData(); | |||
| } | |||
| @@ -55,7 +45,7 @@ public class WxWebLogController extends BaseController | |||
| @GetMapping("/del") | |||
| @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | |||
| public ResultData delete(Long id) { | |||
| wxWebLogService.deleteById(id); | |||
| pushLimitService.deleteById(id); | |||
| return new ResultData(Result.SUCCESS, "删除成功", null); | |||
| } | |||
| @@ -63,7 +53,7 @@ public class WxWebLogController extends BaseController | |||
| @GetMapping("/findById") | |||
| @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | |||
| public ResultData findById(Long id) { | |||
| return new ResultData(Result.SUCCESS,"查询成功",wxWebLogService.getById(id)); | |||
| return new ResultData(Result.SUCCESS,"查询成功",pushLimitService.getById(id)); | |||
| } | |||
| @@ -10,45 +10,47 @@ import com.github.pagehelper.PageInfo; | |||
| import com.simple.common.Result; | |||
| import com.simple.common.ResultData; | |||
| import com.simple.domain.po.WxCouponVerify; | |||
| import com.simple.service.WxCouponVerifyService; | |||
| import com.simple.domain.po.WxAdminLog; | |||
| import com.simple.service.WxAdminLogService; | |||
| import io.swagger.annotations.ApiImplicitParam; | |||
| import io.swagger.annotations.ApiImplicitParams; | |||
| import io.swagger.annotations.ApiOperation; | |||
| @RestController | |||
| @RequestMapping("wxCouponVerify") | |||
| public class WxCouponVerifyController extends BaseController | |||
| @RequestMapping("wxAdminLog") | |||
| public class WxAdminLogController extends BaseController | |||
| { | |||
| @Autowired | |||
| private WxCouponVerifyService wxCouponVerifyService; | |||
| private WxAdminLogService wxAdminLogService; | |||
| private Logger logger = Logger.getLogger(WxCouponVerifyController.class); | |||
| private Logger logger = Logger.getLogger(WxAdminLogController.class); | |||
| @ApiOperation("分页列表接口") | |||
| @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 WxCouponVerify wxCouponVerify,Integer pageNum, Integer pageSize) { | |||
| if (null == wxCouponVerify) wxCouponVerify = new WxCouponVerify(); | |||
| final PageInfo<WxCouponVerify> page = wxCouponVerifyService.listAsPage(wxCouponVerify, pageNum, pageSize); | |||
| 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); | |||
| return new ResultData(page); | |||
| } | |||
| @ApiOperation("新增接口") | |||
| @PostMapping("add") | |||
| public ResultData add(@RequestBody WxCouponVerify wxCouponVerify) { | |||
| //Assert.notNull(wxCouponVerify.getName(), "角色名不能为空"); | |||
| public ResultData add(@RequestBody WxAdminLog wxAdminLog) { | |||
| //Assert.notNull(wxAdminLog.getName(), "角色名不能为空"); | |||
| //Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名"); | |||
| wxCouponVerifyService.saveOrUpdate(wxCouponVerify); | |||
| wxAdminLogService.saveOrUpdate(wxAdminLog); | |||
| return new ResultData(); | |||
| } | |||
| @ApiOperation("根据id更新接口") | |||
| @PostMapping("update") | |||
| public ResultData update(@RequestBody WxCouponVerify wxCouponVerify) { | |||
| wxCouponVerifyService.saveOrUpdate(wxCouponVerify); | |||
| public ResultData update(@RequestBody WxAdminLog wxAdminLog) { | |||
| String tenantId = getTenantId(); | |||
| wxAdminLog.setTenantId(tenantId); | |||
| wxAdminLogService.saveOrUpdate(wxAdminLog); | |||
| return new ResultData(); | |||
| } | |||
| @@ -56,7 +58,7 @@ public class WxCouponVerifyController extends BaseController | |||
| @GetMapping("/del") | |||
| @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | |||
| public ResultData delete(Long id) { | |||
| wxCouponVerifyService.deleteById(id); | |||
| wxAdminLogService.deleteById(id); | |||
| return new ResultData(Result.SUCCESS, "删除成功", null); | |||
| } | |||
| @@ -64,19 +66,16 @@ public class WxCouponVerifyController extends BaseController | |||
| @GetMapping("/findById") | |||
| @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | |||
| public ResultData findById(Long id) { | |||
| return new ResultData(Result.SUCCESS,"查询成功",wxCouponVerifyService.getById(id)); | |||
| return new ResultData(Result.SUCCESS,"查询成功",wxAdminLogService.getById(id)); | |||
| } | |||
| @ApiOperation("根据id更新接口") | |||
| @PostMapping("verify") | |||
| public ResultData verify(@RequestBody WxCouponVerify wxCouponVerify) { | |||
| MallUserInfo user =getUser(); | |||
| wxCouponVerify.setBUserId(user.getId()); | |||
| wxCouponVerify.setTenantId(user.getTenantId()); | |||
| wxCouponVerifyService.saveOrUpdate(wxCouponVerify); | |||
| @ApiOperation("PV计数") | |||
| @PostMapping("pvlog") | |||
| public ResultData pvLog(@RequestBody WxAdminLog wxAdminLog) { | |||
| String tenantId = getTenantId(); | |||
| wxAdminLog.setTenantId(tenantId); | |||
| wxAdminLogService.saveLogCount(wxAdminLog); | |||
| return new ResultData(); | |||
| } | |||
| } | |||
| @@ -1,71 +0,0 @@ | |||
| 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.simple.common.Result; | |||
| import com.simple.common.ResultData; | |||
| import com.simple.domain.po.WxBanners; | |||
| import com.simple.service.WxBannersService; | |||
| import io.swagger.annotations.ApiImplicitParam; | |||
| import io.swagger.annotations.ApiImplicitParams; | |||
| import io.swagger.annotations.ApiOperation; | |||
| @RestController | |||
| @RequestMapping("wxBanners") | |||
| public class WxBannersController extends BaseController | |||
| { | |||
| @Autowired | |||
| private WxBannersService wxBannersService; | |||
| private Logger logger = Logger.getLogger(WxBannersController.class); | |||
| @ApiOperation("分页列表接口") | |||
| @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 WxBanners wxBanners,Integer pageNum, Integer pageSize) { | |||
| if (null == wxBanners) wxBanners = new WxBanners(); | |||
| final PageInfo<WxBanners> page = wxBannersService.listAsPage(wxBanners, pageNum, pageSize); | |||
| return new ResultData(page); | |||
| } | |||
| @ApiOperation("新增接口") | |||
| @PostMapping("add") | |||
| public ResultData add(@RequestBody WxBanners wxBanners) { | |||
| //Assert.notNull(wxBanners.getName(), "角色名不能为空"); | |||
| //Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名"); | |||
| wxBannersService.saveOrUpdate(wxBanners); | |||
| return new ResultData(); | |||
| } | |||
| @ApiOperation("根据id更新接口") | |||
| @PostMapping("update") | |||
| public ResultData update(@RequestBody WxBanners wxBanners) { | |||
| wxBannersService.saveOrUpdate(wxBanners); | |||
| return new ResultData(); | |||
| } | |||
| @ApiOperation("根据id删除接口") | |||
| @GetMapping("/del") | |||
| @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | |||
| public ResultData delete(Long id) { | |||
| wxBannersService.deleteById(id); | |||
| return new ResultData(Result.SUCCESS, "删除成功", null); | |||
| } | |||
| @ApiOperation("根据id查询接口") | |||
| @GetMapping("/findById") | |||
| @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | |||
| public ResultData findById(Long id) { | |||
| return new ResultData(Result.SUCCESS,"查询成功",wxBannersService.getById(id)); | |||
| } | |||
| } | |||
| @@ -94,6 +94,7 @@ public class WxCUserBasicInfoController extends BaseController | |||
| wxCUserBasicInfo.setCUserId(wxCUser.getId()); | |||
| wxCUserBasicInfo.setPhone(wxCUser.getPhone()); | |||
| wxCUserBasicInfo.setTenantId(wxCUser.getTenantId()); | |||
| wxCUserBasicInfo.setNickName(wxCUser.getNickName()); | |||
| wxCUserBasicInfoService.saveOrUpdate(wxCUserBasicInfo); | |||
| } | |||
| @@ -60,6 +60,7 @@ public class WxCampaignController extends BaseController | |||
| String[] arys = wxCampaign.getCouponIds().split(","); | |||
| wxCampaign.setCouponIds(JSON.toJSONString(arys)); | |||
| } | |||
| wxCampaign.setStatus(0); | |||
| wxCampaign.setTenantId(getTenantId()); | |||
| // wxCampaign.setSortNum(sortNum+1); | |||
| wxCampaignService.saveOrUpdate(wxCampaign); | |||
| @@ -61,7 +61,7 @@ public class WxCarCallBackController extends BaseController | |||
| * "remainingDays": "11" | |||
| * } | |||
| */ | |||
| @RequestMapping(value = "/etcpParkInCallback") | |||
| @PostMapping(value = "/etcpParkInCallback") | |||
| public Result etcpParkInCallback(@RequestBody Map<String,String> paramMap) { | |||
| logger.info("etcpParkInCallback: " + paramMap.toString()); | |||
| String etcpParkId = paramMap.get("parkId"); | |||
| @@ -111,8 +111,8 @@ public class WxCarCallBackController extends BaseController | |||
| * "remainingDays": "12" | |||
| * } | |||
| */ | |||
| @RequestMapping(value = "/etcpParkOutCallback") | |||
| public Result etcpParkOutCallback(@RequestParam Map<String,String> paramMap) { | |||
| @PostMapping(value = "/etcpParkOutCallback") | |||
| public Result etcpParkOutCallback(@RequestBody Map<String,String> paramMap) { | |||
| logger.info("etcpParkOutCallback: " + paramMap.toString()); | |||
| String etcpParkId = paramMap.get("parkId"); | |||
| WxPark parkQ = new WxPark(); | |||
| @@ -150,8 +150,8 @@ public class WxCarCallBackController extends BaseController | |||
| * "time": "2017-08-20 11:57:51" | |||
| * } | |||
| */ | |||
| @RequestMapping(value = "/etcpUnbindCarCallBack") | |||
| public Result etcpUnbindCarCallBack(@RequestParam Map<String,String> paramMap) { | |||
| @PostMapping(value = "/etcpUnbindCarCallBack") | |||
| public Result etcpUnbindCarCallBack(@RequestBody Map<String,String> paramMap) { | |||
| logger.info("etcpUnbindCarCallBack: " + paramMap.toString()); | |||
| String carNumber = paramMap.get("plateNumber"); | |||
| @@ -195,8 +195,8 @@ public class WxCarCallBackController extends BaseController | |||
| * "time": "2017-08-20 11:57:51" | |||
| * } | |||
| */ | |||
| @RequestMapping(value = "/etcpPaidCallback") | |||
| public Result etcpPaidCallback(@RequestParam Map<String,String> paramMap) { | |||
| @PostMapping(value = "/etcpPaidCallback") | |||
| public Result etcpPaidCallback(@RequestBody Map<String,String> paramMap) { | |||
| logger.info("etcpPaidCallback: " + paramMap.toString()); | |||
| String carNumber = paramMap.get("plateNumber"); | |||
| @@ -240,7 +240,7 @@ public class WxCarCallBackController extends BaseController | |||
| * } | |||
| */ | |||
| @RequestMapping(value = "/tjdParkInCallback") | |||
| public Map tjdParkInCallback(@RequestParam Map<String,String> paramMap) { | |||
| public Map tjdParkInCallback(@RequestBody Map<String,String> paramMap) { | |||
| logger.info("tjdParkInCallback: " + paramMap.toString()); | |||
| Map map = new HashMap(); | |||
| @@ -293,7 +293,7 @@ public class WxCarCallBackController extends BaseController | |||
| * } | |||
| */ | |||
| @RequestMapping(value = "/tjdParkoutCallback") | |||
| public Map tjdParkOutCallback(@RequestParam Map<String,String> paramMap) { | |||
| public Map tjdParkOutCallback(@RequestBody Map<String,String> paramMap) { | |||
| logger.info("tjdParkoutCallback: " + paramMap.toString()); | |||
| Map map = new HashMap(); | |||
| @@ -15,6 +15,8 @@ import com.simple.service.WxMerchantService; | |||
| import com.simple.service.WxParkService; | |||
| import com.simple.utils.ETCPUtil; | |||
| import com.simple.utils.TJDCarUtil; | |||
| import io.swagger.annotations.ApiImplicitParam; | |||
| import io.swagger.annotations.ApiImplicitParams; | |||
| import io.swagger.annotations.ApiOperation; | |||
| import org.apache.commons.lang3.StringUtils; | |||
| import org.apache.log4j.Logger; | |||
| @@ -107,30 +109,34 @@ public class WxCarController extends BaseController | |||
| " {...},\n" + | |||
| " {...}\n" + | |||
| " ]}}\n") | |||
| @PostMapping("/quanTemplate") | |||
| public ResultData quanTemplate(Map<String, String > paramMap) { | |||
| logger.info("quanTemplate: " + paramMap.toString()); | |||
| @GetMapping("/quanTemplate") | |||
| @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)}) | |||
| public ResultData quanTemplate(String merchantId, Integer pageNum, Integer pageSize) { | |||
| logger.info("quanTemplate: " + merchantId); | |||
| MallUserInfo user = getUser(); | |||
| /// 1, get mall's park | |||
| WxPark park = getCurrentPark(user); | |||
| String params = park.getVendorParams(); | |||
| JSONObject objParams = JSON.parseObject(params); | |||
| String url = objParams.getString("url"); | |||
| String merchantNo = objParams.getString("merchantNo"); | |||
| String merchantKey = objParams.getString("merchantKey"); | |||
| String version = objParams.getString("version"); | |||
| String parkId = park.getParkId(); | |||
| if (park.getVendorType() == EnumCarVendor.CAR_ETCP.getCode()) { | |||
| String merchantIdStr = paramMap.get("merchantId"); | |||
| if (StringUtils.isBlank(merchantIdStr)) { | |||
| if (StringUtils.isBlank(merchantId)) { | |||
| // 优先从从商户表里取 | |||
| logger.error("quanTemplate failed, merchantId为空"); | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "merchantId为空"); | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "商户为空"); | |||
| } | |||
| String params = park.getVendorParams(); | |||
| JSONObject objParams = JSON.parseObject(params); | |||
| String url = objParams.getString("url"); | |||
| String merchantNo = objParams.getString("merchantNo"); | |||
| String merchantKey = objParams.getString("merchantKey"); | |||
| String version = objParams.getString("version"); | |||
| String parkId = park.getParkId(); | |||
| // bussinessId from 参数信息 | |||
| String businessId = ""; | |||
| // 优先从从商户表里取 | |||
| businessId = getETCPBusinessID(merchantIdStr); | |||
| businessId = getETCPBusinessID(merchantId); | |||
| if (StringUtils.isBlank(businessId)) { | |||
| // 1期只有一个虚拟商户,可以写在商场配置里 | |||
| businessId = objParams.getString("businessId"); | |||
| @@ -141,7 +147,7 @@ public class WxCarController extends BaseController | |||
| return new ResultData(retObj.getJSONObject("data")); | |||
| } else { | |||
| logger.error("quanTemplate failed, 优免券模板未发现"); | |||
| return new ResultData(ErrorCode.ETCP_QUAN_TEMP_FAIL.getCode(), "优免券模板未发现"); | |||
| return new ResultData(ErrorCode.ETCP_QUAN_TEMP_FAIL.getCode(), "优免券模板未发现", retObj); | |||
| } | |||
| } | |||
| return new ResultData(ErrorCode.CAR_VENDOR_NOT_SUPPORT.getCode(), "优免券模板失败"); | |||
| @@ -0,0 +1,91 @@ | |||
| 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.simple.common.Result; | |||
| import com.simple.common.ResultData; | |||
| import com.simple.domain.dto.WxLevelConfigDto; | |||
| import com.simple.domain.po.WxLevelConfig; | |||
| import com.simple.service.WxLevelConfigService; | |||
| import io.swagger.annotations.Api; | |||
| import io.swagger.annotations.ApiImplicitParam; | |||
| import io.swagger.annotations.ApiImplicitParams; | |||
| import io.swagger.annotations.ApiOperation; | |||
| @RestController | |||
| @RequestMapping("wxLevelConfig") | |||
| @Api(description="等级权益相关接口") | |||
| public class WxLevelConfigController extends BaseController | |||
| { | |||
| @Autowired | |||
| private WxLevelConfigService wxLevelConfigService; | |||
| private Logger logger = Logger.getLogger(WxLevelConfigController.class); | |||
| @ApiOperation("分页列表接口") | |||
| @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 WxLevelConfig wxLevelConfig,Integer pageNum, Integer pageSize) { | |||
| if (null == wxLevelConfig) wxLevelConfig = new WxLevelConfig(); | |||
| final PageInfo<WxLevelConfig> page = wxLevelConfigService.listAsPage(wxLevelConfig, pageNum, pageSize); | |||
| return new ResultData(page); | |||
| } | |||
| @ApiOperation("新增接口") | |||
| @PostMapping("add") | |||
| public ResultData add(@RequestBody WxLevelConfigDto dto) { | |||
| //Assert.notNull(wxLevelConfig.getName(), "角色名不能为空"); | |||
| //Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名"); | |||
| String[] points = dto.getPoints().split("&"); | |||
| String[] level = dto.getLevel().split("&"); | |||
| String[] descs =dto.getDescription().split("&"); | |||
| String tenantId = getTenantId(); | |||
| wxLevelConfigService.deleteAll(); | |||
| for(int i=0;i<points.length;i++) { | |||
| WxLevelConfig wxLevelConfig = new WxLevelConfig(); | |||
| wxLevelConfig.setTenantId(tenantId); | |||
| wxLevelConfig.setPoints(Integer.parseInt(points[i])); | |||
| wxLevelConfig.setLevel(level[i]); | |||
| wxLevelConfig.setDescription(descs[i]); | |||
| wxLevelConfigService.saveOrUpdate(wxLevelConfig); | |||
| } | |||
| return new ResultData(); | |||
| } | |||
| // @ApiOperation("根据id更新接口") | |||
| // @PostMapping("update") | |||
| // public ResultData update(@RequestBody WxLevelConfig wxLevelConfig) { | |||
| // wxLevelConfig.setTenantId(getTenantId()); | |||
| // wxLevelConfigService.saveOrUpdate(wxLevelConfig); | |||
| // return new ResultData(); | |||
| // } | |||
| @ApiOperation("根据id删除接口") | |||
| @GetMapping("/del") | |||
| @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | |||
| public ResultData delete(Long id) { | |||
| wxLevelConfigService.deleteById(id); | |||
| return new ResultData(Result.SUCCESS, "删除成功", null); | |||
| } | |||
| @ApiOperation("根据id查询接口") | |||
| @GetMapping("/findById") | |||
| @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | |||
| public ResultData findById(Long id) { | |||
| return new ResultData(Result.SUCCESS,"查询成功",wxLevelConfigService.getById(id)); | |||
| } | |||
| } | |||
| @@ -29,6 +29,7 @@ public class WxMerchantController extends BaseController { | |||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | |||
| public ResultData list(@ModelAttribute WxMerchant wxMerchant, Integer pageNum, Integer pageSize) { | |||
| if (null == wxMerchant) wxMerchant = new WxMerchant(); | |||
| wxMerchant.setTenantId(getTenantId()); | |||
| final PageInfo<WxMerchant> page = wxMerchantService.listAsPage(wxMerchant, pageNum, pageSize); | |||
| return new ResultData(page); | |||
| } | |||
| @@ -37,6 +38,7 @@ public class WxMerchantController extends BaseController { | |||
| @GetMapping("etcplist") | |||
| public ResultData etcpList(@ModelAttribute WxMerchant wxMerchant) { | |||
| if (null == wxMerchant) wxMerchant = new WxMerchant(); | |||
| wxMerchant.setTenantId(getTenantId()); | |||
| final List<WxMerchant> merchantList = wxMerchantService.etcpList(wxMerchant); | |||
| return new ResultData(merchantList); | |||
| } | |||
| @@ -11,12 +11,15 @@ import com.simple.common.ResultData; | |||
| import com.simple.domain.po.WxScoreRules; | |||
| import com.simple.service.WxScoreRulesService; | |||
| import io.swagger.annotations.Api; | |||
| import io.swagger.annotations.ApiImplicitParam; | |||
| import io.swagger.annotations.ApiImplicitParams; | |||
| import io.swagger.annotations.ApiOperation; | |||
| @RestController | |||
| @RequestMapping("wxScoreRules") | |||
| @Api(description="成长值规则相关接口") | |||
| public class WxScoreRulesController extends BaseController | |||
| { | |||
| @Autowired | |||
| @@ -40,7 +43,8 @@ public class WxScoreRulesController extends BaseController | |||
| public ResultData add(@RequestBody WxScoreRules wxScoreRules) { | |||
| //Assert.notNull(wxScoreRules.getName(), "角色名不能为空"); | |||
| //Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名"); | |||
| wxScoreRulesService.saveOrUpdate(wxScoreRules); | |||
| wxScoreRules.setTenantId(getTenantId()); | |||
| wxScoreRulesService.saveOrUpdate(wxScoreRules); | |||
| return new ResultData(); | |||
| } | |||
| @@ -13,6 +13,8 @@ import org.apache.log4j.Logger; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.web.bind.annotation.*; | |||
| import java.util.Map; | |||
| @RestController | |||
| @RequestMapping("wxShop") | |||
| public class WxShopController extends BaseController | |||
| @@ -29,7 +31,7 @@ public class WxShopController extends BaseController | |||
| @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(); | |||
| final PageInfo<WxShop> page = wxShopService.listAsPage(wxShop, pageNum, pageSize); | |||
| final PageInfo<Map<String,Object>> page = wxShopService.listMapAsPage(wxShop, pageNum, pageSize); | |||
| return new ResultData(page); | |||
| } | |||
| @@ -1,71 +0,0 @@ | |||
| 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.simple.common.Result; | |||
| import com.simple.common.ResultData; | |||
| import com.simple.domain.po.WxWebLog; | |||
| import com.simple.service.WxWebLogService; | |||
| import io.swagger.annotations.ApiImplicitParam; | |||
| import io.swagger.annotations.ApiImplicitParams; | |||
| import io.swagger.annotations.ApiOperation; | |||
| @RestController | |||
| @RequestMapping("wxWebLog") | |||
| public class WxWebLogController extends BaseController | |||
| { | |||
| @Autowired | |||
| private WxWebLogService wxWebLogService; | |||
| private Logger logger = Logger.getLogger(WxWebLogController.class); | |||
| @ApiOperation("分页列表接口") | |||
| @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 WxWebLog wxWebLog,Integer pageNum, Integer pageSize) { | |||
| if (null == wxWebLog) wxWebLog = new WxWebLog(); | |||
| final PageInfo<WxWebLog> page = wxWebLogService.listAsPage(wxWebLog, pageNum, pageSize); | |||
| return new ResultData(page); | |||
| } | |||
| @ApiOperation("新增接口") | |||
| @PostMapping("add") | |||
| public ResultData add(@RequestBody WxWebLog wxWebLog) { | |||
| //Assert.notNull(wxWebLog.getName(), "角色名不能为空"); | |||
| //Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名"); | |||
| wxWebLogService.saveOrUpdate(wxWebLog); | |||
| return new ResultData(); | |||
| } | |||
| @ApiOperation("根据id更新接口") | |||
| @PostMapping("update") | |||
| public ResultData update(@RequestBody WxWebLog wxWebLog) { | |||
| wxWebLogService.saveOrUpdate(wxWebLog); | |||
| return new ResultData(); | |||
| } | |||
| @ApiOperation("根据id删除接口") | |||
| @GetMapping("/del") | |||
| @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | |||
| public ResultData delete(Long id) { | |||
| wxWebLogService.deleteById(id); | |||
| return new ResultData(Result.SUCCESS, "删除成功", null); | |||
| } | |||
| @ApiOperation("根据id查询接口") | |||
| @GetMapping("/findById") | |||
| @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | |||
| public ResultData findById(Long id) { | |||
| return new ResultData(Result.SUCCESS,"查询成功",wxWebLogService.getById(id)); | |||
| } | |||
| } | |||
| @@ -8,9 +8,11 @@ import java.util.Date; | |||
| import cn.binarywang.wx.miniapp.api.WxMaService; | |||
| import cn.binarywang.wx.miniapp.api.impl.WxMaServiceImpl; | |||
| import cn.binarywang.wx.miniapp.config.WxMaInMemoryConfig; | |||
| import com.simple.common.ErrorCode; | |||
| import com.simple.domain.po.WxAppinfo; | |||
| import com.simple.domain.po.WxCUser; | |||
| import com.simple.domain.po.WxMerchantBUser; | |||
| import com.simple.exception.MallinkException; | |||
| import com.simple.interceptor.AuthorizationInterceptor; | |||
| import com.simple.service.WxAppinfoService; | |||
| import com.simple.service.WxCUserService; | |||
| @@ -59,6 +61,8 @@ public class BaseController { | |||
| HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); | |||
| Long cUserId = (Long) request.getAttribute(AuthorizationInterceptor.LOGIN_USER_KEY); | |||
| WxMerchantBUser user = wxMerchantBUserService.getById(cUserId); | |||
| if (user == null) | |||
| throw new MallinkException(ErrorCode.USER_IS_EMPTY); | |||
| return user; | |||
| } | |||
| @@ -66,6 +70,8 @@ public class BaseController { | |||
| HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); | |||
| Long cUserId = (Long) request.getAttribute(AuthorizationInterceptor.LOGIN_USER_KEY); | |||
| WxMerchantBUser user = wxMerchantBUserService.getById(cUserId); | |||
| if (user == null) | |||
| throw new MallinkException(ErrorCode.USER_IS_EMPTY); | |||
| return user.getTenantId(); | |||
| } | |||
| @@ -28,5 +28,4 @@ public class WxCouponController extends BaseController { | |||
| return new ResultData(Result.SUCCESS, "查询成功", wxCouponService.getById(id)); | |||
| } | |||
| } | |||
| @@ -28,6 +28,79 @@ public class WxCouponOrderController extends BaseController { | |||
| @Autowired | |||
| private WxCouponOrderService wxCouponOrderService; | |||
| @ApiOperation("分页列表接口") | |||
| @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 WxCouponOrder wxCouponOrder, Integer pageNum, Integer pageSize) { | |||
| if (null == wxCouponOrder) wxCouponOrder = new WxCouponOrder(); | |||
| final PageInfo<WxCouponOrder> page = wxCouponOrderService.listAsPage(wxCouponOrder, pageNum, pageSize); | |||
| return new ResultData(page); | |||
| } | |||
| @ApiOperation("根据id更新接口") | |||
| @PostMapping("update") | |||
| public ResultData update(@RequestBody WxCouponOrder wxCouponOrder) { | |||
| wxCouponOrderService.saveOrUpdate(wxCouponOrder); | |||
| return new ResultData(); | |||
| } | |||
| @ApiOperation("交易流水分页列表接口") | |||
| @GetMapping("listUnverified") | |||
| @ApiImplicitParams({ | |||
| @ApiImplicitParam(name = "date", value = "日期yyyy-MM-dd", dataType = "string", paramType = "query"), | |||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query",required = true), | |||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query",required = true)}) | |||
| public ResultData listUnverified(String date, Integer pageNum, Integer pageSize) { | |||
| return wxCouponOrderService.listOnDateAsPage(getUser().getId(), date, pageNum, pageSize, false); | |||
| } | |||
| @ApiOperation("核销流水分页列表接口") | |||
| @GetMapping("listVerified") | |||
| @ApiImplicitParams({ | |||
| @ApiImplicitParam(name = "date", value = "日期yyyy-MM-dd", dataType = "string", paramType = "query"), | |||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query",required = true), | |||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query",required = true)}) | |||
| public ResultData listVerified(String date, Integer pageNum, Integer pageSize) { | |||
| return wxCouponOrderService.listOnDateAsPage(getUser().getId(), date, pageNum, pageSize, true); | |||
| } | |||
| @ApiOperation("某日期交易总流水") | |||
| @GetMapping("getUnverifiedAmountOnDate") | |||
| @ApiImplicitParams({ | |||
| @ApiImplicitParam(name = "date", value = "日期yyyy-MM-dd", dataType = "string", paramType = "query")}) | |||
| public ResultData getUnverifiedAmountOnDate(String date) { | |||
| return wxCouponOrderService.listOnDateAsPage(getUser().getId(), date, null, null, false); | |||
| } | |||
| @ApiOperation("某日期核销总流水") | |||
| @GetMapping("getVerifiedAmountOnDate") | |||
| @ApiImplicitParams({ | |||
| @ApiImplicitParam(name = "date", value = "日期yyyy-MM-dd", dataType = "string", paramType = "query")}) | |||
| public ResultData getVerifiedAmountOnDate(String date) { | |||
| return wxCouponOrderService.listOnDateAsPage(getUser().getId(), date, null, null, true); | |||
| } | |||
| @ApiOperation(value = "卡券详情接口") | |||
| @GetMapping("detail") | |||
| @ApiImplicitParams({ | |||
| @ApiImplicitParam(name = "couponOrderId", value = "券ID", dataType = "string", paramType = "query", required = true) | |||
| }) | |||
| public ResultData detail(String couponOrderId) { | |||
| if(couponOrderId == null) { | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | |||
| } | |||
| return wxCouponOrderService.detailBUserVo(getUser().getId(), couponOrderId); | |||
| } | |||
| @ApiOperation(value = "核销接口", notes = "{\"couponOrderId\":\"string\"}") | |||
| @PostMapping("verify") | |||
| public ResultData verify(@RequestBody Map<String, String> paramMap) { | |||
| @@ -85,23 +158,6 @@ public class WxCouponOrderController extends BaseController { | |||
| } | |||
| } | |||
| @ApiOperation("分页列表接口") | |||
| @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 WxCouponOrder wxCouponOrder, Integer pageNum, Integer pageSize) { | |||
| if (null == wxCouponOrder) wxCouponOrder = new WxCouponOrder(); | |||
| final PageInfo<WxCouponOrder> page = wxCouponOrderService.listAsPage(wxCouponOrder, pageNum, pageSize); | |||
| return new ResultData(page); | |||
| } | |||
| @ApiOperation("根据id更新接口") | |||
| @PostMapping("update") | |||
| public ResultData update(@RequestBody WxCouponOrder wxCouponOrder) { | |||
| wxCouponOrderService.saveOrUpdate(wxCouponOrder); | |||
| return new ResultData(); | |||
| } | |||
| @ApiOperation(value = "根据couponOrderId查询接口", notes = "{\"couponOrderId\":\"string\"}") | |||
| @PostMapping("/findById") | |||
| @@ -33,6 +33,12 @@ public class WxMerchantTradeDailyController extends BaseController | |||
| return wxMerchantTradeDailyService.getVolume(getUser().getId()); | |||
| } | |||
| @ApiOperation("获得近7日解单") | |||
| @GetMapping("/getVolumeOfWeek") | |||
| public ResultData getVolumeOfWeek() { | |||
| return wxMerchantTradeDailyService.getVolumeOfWeek(getUser().getId()); | |||
| } | |||
| @ApiOperation("上报每日解单") | |||
| @GetMapping("/reportDailyVolume") | |||
| @ApiImplicitParam(name="volume",value="总金额(分)",dataType="Integer", paramType = "query",required=true) | |||
| @@ -9,8 +9,10 @@ import cn.binarywang.wx.miniapp.api.WxMaService; | |||
| import cn.binarywang.wx.miniapp.api.impl.WxMaServiceImpl; | |||
| import cn.binarywang.wx.miniapp.config.WxMaInMemoryConfig; | |||
| import com.simple.annotation.AuthIgnore; | |||
| import com.simple.common.ErrorCode; | |||
| import com.simple.domain.po.WxAppinfo; | |||
| import com.simple.domain.po.WxCUser; | |||
| import com.simple.exception.MallinkException; | |||
| import com.simple.interceptor.AuthorizationInterceptor; | |||
| import com.simple.service.WxAppinfoService; | |||
| import com.simple.service.WxCUserService; | |||
| @@ -57,6 +59,8 @@ public class BaseController { | |||
| HttpServletRequest request = ((ServletRequestAttributes)RequestContextHolder.getRequestAttributes()).getRequest(); | |||
| Long cUserId = (Long)request.getAttribute(AuthorizationInterceptor.LOGIN_USER_KEY); | |||
| WxCUser user = wxCUserService.getById(cUserId); | |||
| if (user == null) | |||
| throw new MallinkException(ErrorCode.USER_IS_EMPTY); | |||
| return user; | |||
| } | |||
| @@ -70,10 +74,13 @@ public class BaseController { | |||
| HttpServletRequest request = ((ServletRequestAttributes)RequestContextHolder.getRequestAttributes()).getRequest(); | |||
| Long cUserId = (Long)request.getAttribute(AuthorizationInterceptor.LOGIN_USER_KEY); | |||
| WxCUser user = wxCUserService.getById(cUserId); | |||
| if (user == null) | |||
| throw new MallinkException(ErrorCode.USER_IS_EMPTY); | |||
| return user.getTenantId(); | |||
| } | |||
| public WxAppinfo getAppInfo(String appId) { | |||
| return wxAppinfoService.getByAppId(appId); | |||
| } | |||
| @@ -1,71 +0,0 @@ | |||
| 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.simple.common.Result; | |||
| import com.simple.common.ResultData; | |||
| import com.simple.domain.po.WxBanners; | |||
| import com.simple.service.WxBannersService; | |||
| import io.swagger.annotations.ApiImplicitParam; | |||
| import io.swagger.annotations.ApiImplicitParams; | |||
| import io.swagger.annotations.ApiOperation; | |||
| @RestController | |||
| @RequestMapping("wxBanners") | |||
| public class WxBannersController extends BaseController | |||
| { | |||
| @Autowired | |||
| private WxBannersService wxBannersService; | |||
| private Logger logger = Logger.getLogger(WxBannersController.class); | |||
| @ApiOperation("分页列表接口") | |||
| @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 WxBanners wxBanners,Integer pageNum, Integer pageSize) { | |||
| if (null == wxBanners) wxBanners = new WxBanners(); | |||
| final PageInfo<WxBanners> page = wxBannersService.listAsPage(wxBanners, pageNum, pageSize); | |||
| return new ResultData(page); | |||
| } | |||
| @ApiOperation("新增接口") | |||
| @PostMapping("add") | |||
| public ResultData add(@RequestBody WxBanners wxBanners) { | |||
| //Assert.notNull(wxBanners.getName(), "角色名不能为空"); | |||
| //Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名"); | |||
| wxBannersService.saveOrUpdate(wxBanners); | |||
| return new ResultData(); | |||
| } | |||
| @ApiOperation("根据id更新接口") | |||
| @PostMapping("update") | |||
| public ResultData update(@RequestBody WxBanners wxBanners) { | |||
| wxBannersService.saveOrUpdate(wxBanners); | |||
| return new ResultData(); | |||
| } | |||
| @ApiOperation("根据id删除接口") | |||
| @GetMapping("/del") | |||
| @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | |||
| public ResultData delete(Long id) { | |||
| wxBannersService.deleteById(id); | |||
| return new ResultData(Result.SUCCESS, "删除成功", null); | |||
| } | |||
| @ApiOperation("根据id查询接口") | |||
| @GetMapping("/findById") | |||
| @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | |||
| public ResultData findById(Long id) { | |||
| return new ResultData(Result.SUCCESS,"查询成功",wxBannersService.getById(id)); | |||
| } | |||
| } | |||
| @@ -0,0 +1,37 @@ | |||
| package com.simple.controller; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.simple.common.ResultData; | |||
| import com.simple.domain.po.WxBusiness; | |||
| import com.simple.domain.po.WxCUser; | |||
| import com.simple.service.WxBusinessService; | |||
| import io.swagger.annotations.ApiImplicitParam; | |||
| import io.swagger.annotations.ApiImplicitParams; | |||
| import io.swagger.annotations.ApiOperation; | |||
| 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.RequestMapping; | |||
| import org.springframework.web.bind.annotation.RestController; | |||
| @RestController | |||
| @RequestMapping("/api/wxBusiness") | |||
| public class WxBusinessController extends BaseController { | |||
| private Logger logger = Logger.getLogger(WxBusinessController.class); | |||
| @Autowired | |||
| private WxBusinessService wxBusinessService; | |||
| @ApiOperation("分页列表接口") | |||
| @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(WxBusiness wxBusiness, Integer pageNum, Integer pageSize) { | |||
| if (null == wxBusiness) wxBusiness = new WxBusiness(); | |||
| WxCUser user = getUser(); | |||
| wxBusiness.setTenantId(user.getTenantId()); | |||
| final PageInfo<WxBusiness> page = wxBusinessService.listAsPage(wxBusiness, pageNum, pageSize); | |||
| return new ResultData(page); | |||
| } | |||
| } | |||
| @@ -0,0 +1,94 @@ | |||
| package com.simple.controller; | |||
| import com.alibaba.fastjson.JSON; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.simple.common.Result; | |||
| import com.simple.common.ResultData; | |||
| import com.simple.domain.po.WxCampaign; | |||
| import com.simple.domain.po.WxCoupon; | |||
| import com.simple.service.WxCampaignService; | |||
| import com.simple.service.WxCouponService; | |||
| import io.swagger.annotations.Api; | |||
| import io.swagger.annotations.ApiImplicitParam; | |||
| import io.swagger.annotations.ApiImplicitParams; | |||
| import io.swagger.annotations.ApiOperation; | |||
| import org.apache.commons.lang3.StringUtils; | |||
| import org.apache.log4j.Logger; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.web.bind.annotation.*; | |||
| import java.util.ArrayList; | |||
| import java.util.List; | |||
| import static com.simple.domain.po.WxCampaign.Field.SortNum_ASC; | |||
| @RestController | |||
| @RequestMapping("/api/wxCampaign") | |||
| @Api(description="促销和banner接口") | |||
| public class WxCampaignController extends BaseController | |||
| { | |||
| @Autowired | |||
| private WxCampaignService wxCampaignService; | |||
| @Autowired | |||
| private WxCouponService wxCouponService; | |||
| private Logger logger = Logger.getLogger(WxCampaignController.class); | |||
| @ApiOperation("分页列表接口") | |||
| @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 WxCampaign wxCampaign, Integer pageNum, Integer pageSize) { | |||
| if (null == wxCampaign) wxCampaign = new WxCampaign(); | |||
| if(wxCampaign.getStatus()!=null&&wxCampaign.getStatus()==-1){ | |||
| wxCampaign.setStatus(null); | |||
| } | |||
| wxCampaign.setTenantId(getTenantId()); | |||
| wxCampaign.setSortColumns(SortNum_ASC); | |||
| final PageInfo<WxCampaign> page = wxCampaignService.listAsPage(wxCampaign, pageNum, pageSize); | |||
| return new ResultData(page); | |||
| } | |||
| @ApiOperation("根据id查询接口") | |||
| @GetMapping("/findById") | |||
| @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | |||
| public ResultData findById(Long id) { | |||
| WxCampaign wxCampaign = wxCampaignService.getById(id); | |||
| if (wxCampaign != null) { | |||
| List<Long> list = new ArrayList<>(); | |||
| List<String> templist = JSON.parseArray(wxCampaign.getCouponIds(), String.class); | |||
| for (String temp : templist | |||
| ) { | |||
| list.add(Long.parseLong(temp)); | |||
| } | |||
| WxCoupon wxCoupon = new WxCoupon(); | |||
| wxCoupon.setTenantId(getTenantId()); | |||
| wxCoupon.setIds(list); | |||
| wxCoupon.setStatus(1); | |||
| List<WxCoupon> couponlist = wxCouponService.findList(wxCoupon); | |||
| wxCampaign.setCoupons(couponlist); | |||
| } | |||
| return new ResultData(Result.SUCCESS, "查询成功", wxCampaign); | |||
| } | |||
| @ApiOperation("调整顺序") | |||
| @GetMapping("/move") | |||
| @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); | |||
| WxCampaign target = wxCampaignService.getById(targetId); | |||
| if(source==null||target==null){ | |||
| return new ResultData(Result.ERROR, "调整顺序失败", null); | |||
| } | |||
| int temp =source.getSortNum(); | |||
| source.setSortNum(target.getSortNum()); | |||
| target.setSortNum(temp); | |||
| wxCampaignService.saveOrUpdate(source); | |||
| wxCampaignService.saveOrUpdate(target); | |||
| return new ResultData(Result.SUCCESS, "调整顺序成功", null); | |||
| } | |||
| } | |||
| @@ -29,7 +29,7 @@ import java.util.List; | |||
| import java.util.Map; | |||
| @RestController | |||
| @RequestMapping("/car") | |||
| @RequestMapping("/api/car") | |||
| public class WxCarController extends BaseController | |||
| { | |||
| private Logger logger = Logger.getLogger(WxCarController.class); | |||
| @@ -74,16 +74,21 @@ public class WxCarController extends BaseController | |||
| */ | |||
| @ApiOperation(value = "初始化/etcp共同登录",notes="{\"phone\":\"string\"}") | |||
| @PostMapping("/init") | |||
| public ResultData init(Map<String, String > paramMap) { | |||
| public ResultData init(@RequestBody Map<String, String > paramMap) { | |||
| WxCUser user = getUser(); | |||
| // 1, get mall's park | |||
| WxPark park = getCurrentPark(user); | |||
| // 2. get vendor params | |||
| if (park.getVendorType() == EnumCarVendor.CAR_ETCP.getCode()) { | |||
| String phone = paramMap.get("phone"); | |||
| if (StringUtils.isBlank(phone)) { | |||
| logger.error("手机号为空"); | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "phone为空"); | |||
| if (StringUtils.isBlank(phone) && StringUtils.isBlank(user.getPhone()) && StringUtils.isBlank(user.getVerifyCodePhone())) { | |||
| logger.error("手机号为空,请授权手机号"); | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "手机号为空,请授权手机号"); | |||
| } | |||
| if (!StringUtils.isBlank(user.getPhone()) && !user.getPhone().contains("*")) { | |||
| phone = user.getPhone(); | |||
| } else { | |||
| phone = user.getVerifyCodePhone(); | |||
| } | |||
| String params = park.getVendorParams(); | |||
| JSONObject objParams = JSON.parseObject(params); | |||
| @@ -98,19 +103,22 @@ public class WxCarController extends BaseController | |||
| if (retObj.getIntValue("code") == EnumETCPCode.SUCCESS.getCode()) { | |||
| // 获取绑定的车牌 | |||
| JSONObject dataObj = retObj.getJSONObject("data"); | |||
| dataObj.put("vendor", EnumCarVendor.CAR_ETCP.getCode()); | |||
| String etcpToken = dataObj.getString("token"); | |||
| JSONObject dataObj1 = syncCarNumbers(user.getId(), user.getTenantId(), park.getVendorType(), | |||
| url, merchantNo, merchantKey, version, | |||
| etcpToken); | |||
| // c端必须保存此token | |||
| return new ResultData(dataObj1); | |||
| return new ResultData(dataObj); | |||
| } else { | |||
| logger.error("共同登录失败: "+phone); | |||
| return new ResultData(ErrorCode.ETCP_LOGIN_FAIL.getCode(), "共同登录失败"); | |||
| } | |||
| } else if (park.getVendorType() == EnumCarVendor.CAR_TJD.getCode()){ | |||
| // TJD不需要共同登录 | |||
| return new ResultData(); | |||
| Map resultMap = new HashMap(); | |||
| resultMap.put("vendor", EnumCarVendor.CAR_TJD.getCode()); | |||
| return new ResultData(resultMap); | |||
| } | |||
| return new ResultData(ErrorCode.CAR_VENDOR_NOT_SUPPORT.getCode(), "登录失败"); | |||
| @@ -210,7 +218,7 @@ public class WxCarController extends BaseController | |||
| " \"carId\": \"5836b8b52ada463ebc6199579f029561\"\n" + | |||
| "}\n") | |||
| @PostMapping("/bindCar") | |||
| public ResultData bindCar(Map<String, String > paramMap) { | |||
| public ResultData bindCar(@RequestBody Map<String, String > paramMap) { | |||
| WxCUser user = getUser(); | |||
| // 1, get mall's park | |||
| WxPark park = getCurrentPark(user); | |||
| @@ -247,11 +255,11 @@ public class WxCarController extends BaseController | |||
| userCar.setUpdateDate(curr); | |||
| wxCUserCarService.saveOrUpdate(userCar); | |||
| JSONObject dataObj = retObj.getJSONObject("data"); | |||
| dataObj.put("vendor", park.getVendorType()); | |||
| return new ResultData(dataObj); | |||
| } else { | |||
| String message = retObj.getString("message"); | |||
| logger.error("绑车牌失败: " + carNumber); | |||
| return new ResultData(ErrorCode.ETCP_BIND_FAIL.getCode(), "绑车牌失败"); | |||
| return new ResultData(ErrorCode.ETCP_BIND_FAIL.getCode(), message, retObj); | |||
| } | |||
| } | |||
| else if (park.getVendorType() == EnumCarVendor.CAR_TJD.getCode()) { | |||
| @@ -261,14 +269,16 @@ public class WxCarController extends BaseController | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "carNumber为空"); | |||
| } | |||
| String carNumColor = paramMap.get("carNumColor"); | |||
| if (StringUtils.isBlank(carNumColor)) { | |||
| logger.error("carNumColor为空"); | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "carNumColor为空"); | |||
| } | |||
| //if (StringUtils.isBlank(carNumColor)) { | |||
| // logger.error("carNumColor为空"); | |||
| // return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "carNumColor为空"); | |||
| //} | |||
| Long newCarId = 0L; | |||
| String outCarId = paramMap.get("outCarId"); | |||
| if (StringUtils.isBlank(outCarId)) { | |||
| logger.error("outCarId为空"); | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "outCarId为空"); | |||
| logger.warn("outCarId为空"); | |||
| newCarId = wxCUserCarService.getNewCarID(); | |||
| outCarId = String.valueOf(newCarId); | |||
| } | |||
| String params = park.getVendorParams(); | |||
| JSONObject objParams = JSON.parseObject(params); | |||
| @@ -284,18 +294,19 @@ public class WxCarController extends BaseController | |||
| String carId = retObj.getString("carId"); | |||
| // 插入车牌 | |||
| Date curr = new Date(); | |||
| WxCUserCar userCar = new WxCUserCar(); | |||
| userCar.setId(newCarId); | |||
| userCar.setCUserId(user.getId()); | |||
| userCar.setTenantId(user.getTenantId()); | |||
| userCar.setCarNumber(carNumber); | |||
| userCar.setVendorType(EnumCarVendor.CAR_TJD.getCode()); | |||
| JSONObject jo = new JSONObject(); | |||
| jo.put("carId", carId); | |||
| userCar.setVendorParams(JSON.toJSONString(jo)); | |||
| userCar.setCreateDate(curr); | |||
| userCar.setUpdateDate(curr); | |||
| try { | |||
| WxCUserCar userCar = new WxCUserCar(); | |||
| userCar.setCUserId(user.getId()); | |||
| userCar.setTenantId(user.getTenantId()); | |||
| userCar.setCarNumber(carNumber); | |||
| userCar.setVendorType(EnumCarVendor.CAR_TJD.getCode()); | |||
| JSONObject jo = new JSONObject(); | |||
| jo.put("carId", carId); | |||
| userCar.setVendorParams(JSON.toJSONString(jo)); | |||
| userCar.setCreateDate(curr); | |||
| userCar.setUpdateDate(curr); | |||
| wxCUserCarService.saveOrUpdate(userCar); | |||
| wxCUserCarService.save(userCar); | |||
| } catch (Exception e) { | |||
| logger.error(e.getMessage()); | |||
| return new ResultData(ErrorCode.DB_FAIL.getCode(), "TJD保存车牌失败, e:" + e.getMessage()); | |||
| @@ -327,7 +338,7 @@ public class WxCarController extends BaseController | |||
| " \"isSuccess\": \"0\",\n" + | |||
| "}\n") | |||
| @PostMapping("/unbindCar") | |||
| public ResultData unbindCar(Map<String, String > paramMap) { | |||
| public ResultData unbindCar(@RequestBody Map<String, String > paramMap) { | |||
| WxCUser user = getUser(); | |||
| // 1, get mall's park | |||
| WxPark park = getCurrentPark(user); | |||
| @@ -365,8 +376,9 @@ public class WxCarController extends BaseController | |||
| return new ResultData(); | |||
| } else { | |||
| String message = retObj.getString("message"); | |||
| logger.error("解绑车牌失败"); | |||
| return new ResultData(ErrorCode.ETCP_UNBIND_FAIL.getCode(), "解绑车牌失败"); | |||
| return new ResultData(ErrorCode.ETCP_UNBIND_FAIL.getCode(), message, retObj); | |||
| } | |||
| } | |||
| else if (park.getVendorType() == EnumCarVendor.CAR_TJD.getCode()) { | |||
| @@ -450,7 +462,7 @@ public class WxCarController extends BaseController | |||
| " \"pmParkId\": \"d49aeaedcf144f1faf569846d6b16670\"\n" + | |||
| " }") | |||
| @PostMapping("/getCarStopFee") | |||
| public ResultData getCarStopFee(Map<String, String > paramMap) { | |||
| public ResultData getCarStopFee(@RequestBody Map<String, String > paramMap) { | |||
| WxCUser user = getUser(); | |||
| // 1, get mall's park | |||
| WxPark park = getCurrentPark(user); | |||
| @@ -475,10 +487,10 @@ public class WxCarController extends BaseController | |||
| JSONObject retObj = JSON.parseObject(ret); | |||
| if (retObj.getIntValue("code") == 0) { | |||
| JSONObject feeObj = retObj.getJSONArray("data").getJSONObject(0); | |||
| feeObj.put("vendor", park.getVendorType()); | |||
| return new ResultData(Result.SUCCESS, "停车费获取成功", feeObj); | |||
| } else { | |||
| return new ResultData(ErrorCode.ETCP_STOP_FEE_FAIL.getCode(), "停车费获取失败"); | |||
| String message = retObj.getString("message"); | |||
| return new ResultData(ErrorCode.ETCP_STOP_FEE_FAIL.getCode(), message, retObj); | |||
| } | |||
| } | |||
| else if (park.getVendorType() == EnumCarVendor.CAR_TJD.getCode()) { | |||
| @@ -516,7 +528,7 @@ public class WxCarController extends BaseController | |||
| " \"carId\": \"5836b8b52ada463ebc6199579f029561\"\n" + | |||
| " }") | |||
| @PostMapping("/deductionFee") | |||
| public ResultData deductionFee(Map<String, String > paramMap) { | |||
| public ResultData deductionFee(@RequestBody Map<String, String > paramMap) { | |||
| WxCUser user = getUser(); | |||
| /// 1, get mall's park | |||
| WxPark park = getCurrentPark(user); | |||
| @@ -575,7 +587,7 @@ public class WxCarController extends BaseController | |||
| */ | |||
| @ApiOperation(value = "优免券领取", notes="ETCP:={\"etcpToken\":\"string\",\"carNumber\":\"string\",\"couponFreeId\":\"string\"},输出\n{}") | |||
| @PostMapping("/getCoupon") | |||
| public ResultData getCoupon(Map<String, String > paramMap) { | |||
| public ResultData getCoupon(@RequestBody Map<String, String > paramMap) { | |||
| WxCUser user = getUser(); | |||
| /// 1, get mall's park | |||
| WxPark park = getCurrentPark(user); | |||
| @@ -1,5 +1,7 @@ | |||
| package com.simple.controller; | |||
| import com.simple.common.ErrorCode; | |||
| import com.simple.domain.vo.WxCouponCVo; | |||
| import org.apache.log4j.Logger; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.util.Assert; | |||
| @@ -31,8 +33,22 @@ public class WxCouponController extends BaseController { | |||
| public ResultData list(@ModelAttribute WxCoupon wxCoupon, Integer pageNum, Integer pageSize) { | |||
| if (null == wxCoupon) wxCoupon = new WxCoupon(); | |||
| wxCoupon.setTenantId(getTenantId()); | |||
| final PageInfo<WxCoupon> page = wxCouponService.listAsPage(wxCoupon, pageNum, pageSize); | |||
| return new ResultData(page); | |||
| return new ResultData(wxCouponService.findListForCUser(wxCoupon, pageNum, pageSize)); | |||
| } | |||
| @ApiOperation("根据id查询接口") | |||
| @GetMapping("/detail") | |||
| @ApiImplicitParam(name = "couponId", value = "id", dataType = "String", paramType = "query", required = true) | |||
| public ResultData detail(String couponId) { | |||
| WxCoupon wxCoupon = new WxCoupon(); | |||
| wxCoupon.setTenantId(getTenantId()); | |||
| wxCoupon.setId(Long.valueOf(couponId)); | |||
| WxCouponCVo wxCouponCVo = wxCouponService.selectDetailForCUser(wxCoupon); | |||
| if (wxCouponCVo == null) | |||
| return new ResultData(ErrorCode.COUPON_IS_EMPTY); | |||
| return new ResultData(wxCouponCVo); | |||
| } | |||
| @ApiOperation("根据id查询接口") | |||
| @@ -42,5 +58,4 @@ public class WxCouponController extends BaseController { | |||
| return new ResultData(Result.SUCCESS, "查询成功", wxCouponService.getById(id)); | |||
| } | |||
| } | |||
| @@ -6,6 +6,7 @@ import com.simple.common.Result; | |||
| import com.simple.common.ResultData; | |||
| import com.simple.domain.po.WxCUser; | |||
| import com.simple.domain.po.WxCouponOrder; | |||
| import com.simple.domain.vo.WxCouponOrderCVo; | |||
| import com.simple.exception.MallinkException; | |||
| import com.simple.service.WxCouponOrderService; | |||
| import io.swagger.annotations.Api; | |||
| @@ -56,8 +57,7 @@ public class WxCouponOrderController extends BaseController { | |||
| } | |||
| } | |||
| @ApiOperation("分页列表接口") | |||
| @ApiOperation("券包分页列表接口") | |||
| @GetMapping("list") | |||
| @ApiImplicitParams({ | |||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||
| @@ -65,31 +65,24 @@ public class WxCouponOrderController extends BaseController { | |||
| @ApiImplicitParam(name = "couponOrderStatus", value="券状态状态:0,待使用 1,已核销 2,已过期 3,已作废", dataType="int", paramType = "query",required=false) | |||
| }) | |||
| public ResultData list(Integer couponOrderStatus, Integer pageNum, Integer pageSize) { | |||
| WxCUser user = getUser(); | |||
| WxCouponOrder wxCouponOrder = new WxCouponOrder(); | |||
| wxCouponOrder.setTenantId(user.getTenantId()); | |||
| wxCouponOrder.setCouponOrderStatus(couponOrderStatus); | |||
| final PageInfo<WxCouponOrder> page = wxCouponOrderService.listAsPage(wxCouponOrder, pageNum, pageSize); | |||
| return new ResultData(page); | |||
| } | |||
| @ApiOperation(value = "根据id查询接口", notes = "{\"couponOrderId\":\"string\"}") | |||
| @PostMapping("/findById") | |||
| public ResultData findById(@RequestBody Map<String, String> paramMap) { | |||
| logger.info(paramMap.toString()); | |||
| String couponOrderIdStr = paramMap.get("couponOrderId"); | |||
| if (StringUtils.isBlank(couponOrderIdStr)) { | |||
| logger.error("couponOrderId不能为空: " + paramMap.toString()); | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "couponOrderId不能为空"); | |||
| if(pageNum == null || pageSize == null) { | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | |||
| } | |||
| Long couponOrderId = 0L; | |||
| try { | |||
| couponOrderId = Long.valueOf(couponOrderIdStr); | |||
| } catch (NumberFormatException e) { | |||
| couponOrderId = 0L; | |||
| logger.error("couponOrderId参数不正确: " + paramMap.toString()); | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "couponOrderId参数不正确"); | |||
| return wxCouponOrderService.listCUserVoAsPage(getUser().getId(), couponOrderStatus, pageNum, pageSize); | |||
| } | |||
| @ApiOperation(value = "卡券详情接口") | |||
| @GetMapping("detail") | |||
| @ApiImplicitParams({ | |||
| @ApiImplicitParam(name = "couponOrderId", value = "券ID", dataType = "string", paramType = "query", required = true) | |||
| }) | |||
| public ResultData detail(String couponOrderId) { | |||
| if(couponOrderId == null) { | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | |||
| } | |||
| return new ResultData(Result.SUCCESS, "查询成功", wxCouponOrderService.getById(couponOrderId)); | |||
| return wxCouponOrderService.detailCUserVo(getUser().getId(), couponOrderId); | |||
| } | |||
| } | |||
| @@ -1,71 +0,0 @@ | |||
| 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.simple.common.Result; | |||
| import com.simple.common.ResultData; | |||
| import com.simple.domain.po.WxCouponVerify; | |||
| import com.simple.service.WxCouponVerifyService; | |||
| import io.swagger.annotations.ApiImplicitParam; | |||
| import io.swagger.annotations.ApiImplicitParams; | |||
| import io.swagger.annotations.ApiOperation; | |||
| @RestController | |||
| @RequestMapping("wxCouponVerify") | |||
| public class WxCouponVerifyController extends BaseController | |||
| { | |||
| @Autowired | |||
| private WxCouponVerifyService wxCouponVerifyService; | |||
| private Logger logger = Logger.getLogger(WxCouponVerifyController.class); | |||
| @ApiOperation("分页列表接口") | |||
| @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 WxCouponVerify wxCouponVerify,Integer pageNum, Integer pageSize) { | |||
| if (null == wxCouponVerify) wxCouponVerify = new WxCouponVerify(); | |||
| final PageInfo<WxCouponVerify> page = wxCouponVerifyService.listAsPage(wxCouponVerify, pageNum, pageSize); | |||
| return new ResultData(page); | |||
| } | |||
| @ApiOperation("新增接口") | |||
| @PostMapping("add") | |||
| public ResultData add(@RequestBody WxCouponVerify wxCouponVerify) { | |||
| //Assert.notNull(wxCouponVerify.getName(), "角色名不能为空"); | |||
| //Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名"); | |||
| wxCouponVerifyService.saveOrUpdate(wxCouponVerify); | |||
| return new ResultData(); | |||
| } | |||
| @ApiOperation("根据id更新接口") | |||
| @PostMapping("update") | |||
| public ResultData update(@RequestBody WxCouponVerify wxCouponVerify) { | |||
| wxCouponVerifyService.saveOrUpdate(wxCouponVerify); | |||
| return new ResultData(); | |||
| } | |||
| @ApiOperation("根据id删除接口") | |||
| @GetMapping("/del") | |||
| @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | |||
| public ResultData delete(Long id) { | |||
| wxCouponVerifyService.deleteById(id); | |||
| return new ResultData(Result.SUCCESS, "删除成功", null); | |||
| } | |||
| @ApiOperation("根据id查询接口") | |||
| @GetMapping("/findById") | |||
| @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | |||
| public ResultData findById(Long id) { | |||
| return new ResultData(Result.SUCCESS,"查询成功",wxCouponVerifyService.getById(id)); | |||
| } | |||
| } | |||
| @@ -1,6 +1,7 @@ | |||
| package com.simple.controller; | |||
| import com.simple.common.ResultData; | |||
| import com.simple.domain.po.WxCUser; | |||
| import com.simple.domain.po.WxMsgValidationcode; | |||
| import com.simple.service.WxMerchantBUserService; | |||
| import com.simple.service.WxMerchantService; | |||
| @@ -33,34 +34,31 @@ public class WxMsgValidationcodeController extends BaseController { | |||
| @GetMapping("sendvalidationcode") | |||
| @ApiImplicitParams({ | |||
| @ApiImplicitParam(name = "tenantId", value = "租户ID", dataType = "String", paramType = "query"), | |||
| @ApiImplicitParam(name = "phone", value = "手机号", dataType = "String", paramType = "query", required = true), | |||
| @ApiImplicitParam(name = "type", value = "场景", dataType = "Integer", paramType = "query", required = true), | |||
| @ApiImplicitParam(name = "appid", value = "appid", dataType = "String", paramType = "query", required = true)}) | |||
| public ResultData sendvalidationcode(String tenantId, String phone, Integer type, String appid) { | |||
| @ApiImplicitParam(name = "type", value = "场景", dataType = "Integer", paramType = "query", required = true)}) | |||
| public ResultData sendvalidationcode(String phone, Integer type) { | |||
| WxCUser user = getUser(); | |||
| WxMsgValidationcode wxMsgValidationcode = new WxMsgValidationcode(); | |||
| wxMsgValidationcode.setTenantId(tenantId); | |||
| wxMsgValidationcode.setTenantId(user.getTenantId()); | |||
| wxMsgValidationcode.setPhone(phone); | |||
| wxMsgValidationcode.setType(type); | |||
| wxMsgValidationcode.setAppid(appid); | |||
| wxMsgValidationcode.setAppid(user.getAppId()); | |||
| return wxMsgValidationcodeService.sendvalidationcode(wxMsgValidationcode); | |||
| } | |||
| @GetMapping("hasvalidationcode") | |||
| @ApiImplicitParams({ | |||
| @ApiImplicitParam(name = "tenantId", value = "租户ID", dataType = "String", paramType = "query"), | |||
| @ApiImplicitParam(name = "phone", value = "手机号", dataType = "String", paramType = "query", required = true), | |||
| @ApiImplicitParam(name = "type", value = "场景", dataType = "Integer", paramType = "query", required = true), | |||
| @ApiImplicitParam(name = "code", value = "验证码", dataType = "String", paramType = "query", required = true), | |||
| @ApiImplicitParam(name = "appid", value = "appid", dataType = "String", paramType = "query", required = true)}) | |||
| public ResultData hasvalidationcode(String tenantId, String phone, Integer type, String code, String appid) { | |||
| @ApiImplicitParam(name = "code", value = "验证码", dataType = "String", paramType = "query", required = true)}) | |||
| public ResultData hasvalidationcode(String phone, Integer type, String code) { | |||
| WxCUser user = getUser(); | |||
| WxMsgValidationcode wxMsgValidationcode = new WxMsgValidationcode(); | |||
| wxMsgValidationcode.setTenantId(tenantId); | |||
| wxMsgValidationcode.setTenantId(user.getTenantId()); | |||
| wxMsgValidationcode.setPhone(phone); | |||
| wxMsgValidationcode.setType(type); | |||
| wxMsgValidationcode.setCode(code); | |||
| wxMsgValidationcode.setAppid(appid); | |||
| wxMsgValidationcode.setAppid(user.getAppId()); | |||
| return wxMsgValidationcodeService.hasvalidationcode(wxMsgValidationcode); | |||
| } | |||
| @@ -1,71 +1,40 @@ | |||
| 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.simple.common.ErrorCode; | |||
| import com.simple.common.Result; | |||
| import com.simple.common.ResultData; | |||
| import com.simple.domain.po.WxCUser; | |||
| import com.simple.domain.po.WxPark; | |||
| import com.simple.pay.WxPay; | |||
| import com.simple.service.WxParkService; | |||
| import io.swagger.annotations.ApiImplicitParam; | |||
| import io.swagger.annotations.ApiImplicitParams; | |||
| import io.swagger.annotations.ApiOperation; | |||
| import org.apache.log4j.Logger; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.web.bind.annotation.*; | |||
| @RestController | |||
| @RequestMapping("wxPark") | |||
| public class WxParkController extends BaseController | |||
| { | |||
| @Autowired | |||
| private WxParkService wxParkService; | |||
| @RequestMapping("/api/wxPark") | |||
| public class WxParkController extends BaseController { | |||
| private Logger logger = Logger.getLogger(WxParkController.class); | |||
| @ApiOperation("分页列表接口") | |||
| @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(); | |||
| final PageInfo<WxPark> page = wxParkService.listAsPage(wxPark, pageNum, pageSize); | |||
| return new ResultData(page); | |||
| } | |||
| @ApiOperation("新增接口") | |||
| @PostMapping("add") | |||
| public ResultData add(@RequestBody WxPark wxPark) { | |||
| //Assert.notNull(wxPark.getName(), "角色名不能为空"); | |||
| //Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名"); | |||
| wxParkService.saveOrUpdate(wxPark); | |||
| return new ResultData(); | |||
| } | |||
| @Autowired | |||
| private WxParkService wxParkService; | |||
| @ApiOperation("根据id更新接口") | |||
| @PostMapping("update") | |||
| public ResultData update(@RequestBody WxPark wxPark) { | |||
| wxParkService.saveOrUpdate(wxPark); | |||
| return new ResultData(); | |||
| @ApiOperation("查找用户车场信息") | |||
| @GetMapping("/info") | |||
| public ResultData findById() { | |||
| WxCUser user = getUser(); | |||
| WxPark parkQ = new WxPark(); | |||
| parkQ.setTenantId(user.getTenantId()); | |||
| WxPark park = wxParkService.getByObj(parkQ); | |||
| if (park == null) { | |||
| logger.error("车场未取到"); | |||
| return new ResultData(ErrorCode.CAR_PARK_NOT_FOUND); | |||
| } | |||
| return new ResultData(Result.SUCCESS, "查询成功", park); | |||
| } | |||
| @ApiOperation("根据id删除接口") | |||
| @GetMapping("/del") | |||
| @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | |||
| public ResultData delete(Long id) { | |||
| wxParkService.deleteById(id); | |||
| return new ResultData(Result.SUCCESS, "删除成功", null); | |||
| } | |||
| @ApiOperation("根据id查询接口") | |||
| @GetMapping("/findById") | |||
| @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | |||
| public ResultData findById(Long id) { | |||
| return new ResultData(Result.SUCCESS,"查询成功",wxParkService.getById(id)); | |||
| } | |||
| } | |||
| @@ -282,8 +282,31 @@ public class WxUserGrantController extends BaseController { | |||
| return new ResultData(Result.SUCCESS,"查询成功",user); | |||
| } | |||
| @ApiOperation("当前用户名下是否有车") | |||
| @GetMapping("/carCount") | |||
| public ResultData carCount() { | |||
| WxCUser user = getUser(); | |||
| WxCUserCar userCar = new WxCUserCar(); | |||
| userCar.setTenantId(user.getTenantId()); | |||
| userCar.setCUserId(user.getId()); | |||
| Integer count = wxCUserCarService.countUserCar(userCar); | |||
| if (count > 0) { | |||
| Map returnMap = new HashMap(); | |||
| String phone = user.getPhone(); | |||
| if (phone.contains("*")) | |||
| phone = user.getVerifyCodePhone(); | |||
| returnMap.put("phone", phone); | |||
| returnMap.put("count", count); | |||
| return new ResultData(Result.SUCCESS,"count获取成功", returnMap); | |||
| } else { | |||
| Map returnMap = new HashMap(); | |||
| returnMap.put("count", count); | |||
| return new ResultData(Result.SUCCESS,"count获取成功", returnMap); | |||
| } | |||
| } | |||
| @ApiOperation("获取当前用户车牌列表") | |||
| @GetMapping("/carlist") | |||
| @GetMapping("/carList") | |||
| public ResultData getCarList() { | |||
| WxCUser user = getUser(); | |||
| WxCUserCar userCar = new WxCUserCar(); | |||
| @@ -156,8 +156,8 @@ public enum ErrorCode{ | |||
| /** | |||
| * 解单 | |||
| */ | |||
| DALIY_REPORT_VOLUME_TODAY_NULL(12070, "今日解单不存在") | |||
| DALIY_REPORT_VOLUME_TODAY_NULL(12070, "今日解单不存在"), | |||
| DALIY_REPORT_VOLUME_WEEK_NULL(12071, "无解单数据") | |||
| ; | |||
| @@ -0,0 +1,45 @@ | |||
| package com.simple.domain.dto; | |||
| import java.io.Serializable; | |||
| /** | |||
| * 等级权益dto | |||
| * @author jinguo | |||
| * | |||
| */ | |||
| public class WxLevelConfigDto implements Serializable{ | |||
| /** | |||
| * | |||
| */ | |||
| private static final long serialVersionUID = -8155943956044066653L; | |||
| /*成长值**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="成长值",name="points") | |||
| private String points; | |||
| /*等级**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="等级",name="level") | |||
| private String level; | |||
| /*描述**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="描述",name="description") | |||
| private String description; | |||
| public String getPoints() { | |||
| return points; | |||
| } | |||
| public void setPoints(String points) { | |||
| this.points = points; | |||
| } | |||
| public String getLevel() { | |||
| return level; | |||
| } | |||
| public void setLevel(String level) { | |||
| this.level = level; | |||
| } | |||
| public String getDescription() { | |||
| return description; | |||
| } | |||
| public void setDescription(String description) { | |||
| this.description = description; | |||
| } | |||
| } | |||
| @@ -1,11 +1,12 @@ | |||
| package com.simple.domain.po; | |||
| import javax.persistence.Id; | |||
| import javax.persistence.Table; | |||
| import javax.persistence.*; | |||
| import java.util.*; | |||
| import java.math.*; | |||
| import javax.persistence.Transient; | |||
| import java.io.Serializable; | |||
| import java.util.ArrayList; | |||
| import java.util.List; | |||
| import javax.persistence.Id; | |||
| import java.io.Serializable; | |||
| @Table(name = "mall_permission") | |||
| public class MallPermission implements Serializable { | |||
| @@ -15,7 +16,7 @@ public class MallPermission implements Serializable { | |||
| protected Long id; | |||
| @Transient | |||
| protected List<String> ids; | |||
| protected List<Long> ids; | |||
| @Transient | |||
| protected String sortColumns; | |||
| @@ -31,10 +32,11 @@ public class MallPermission implements Serializable { | |||
| return sortColumns; | |||
| } | |||
| public List<String> getIds() { | |||
| public List<Long> getIds() { | |||
| return ids; | |||
| } | |||
| public void setIds(List<String> ids) { | |||
| public void setIds(List<Long> ids) { | |||
| this.ids = ids; | |||
| } | |||
| @@ -53,7 +55,7 @@ public class MallPermission implements Serializable { | |||
| private String available; | |||
| /*父编号**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="父编号",name="parentId") | |||
| private String parentId; | |||
| private Long parentId; | |||
| /*父编号列表**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="父编号列表",name="parentIds") | |||
| private String parentIds; | |||
| @@ -107,10 +109,10 @@ public class MallPermission implements Serializable { | |||
| public void setAvailable(String _available) { | |||
| available = _available; | |||
| } | |||
| public String getParentId() { | |||
| public Long getParentId() { | |||
| return parentId; | |||
| } | |||
| public void setParentId(String _parentId) { | |||
| public void setParentId(Long _parentId) { | |||
| parentId = _parentId; | |||
| } | |||
| public String getParentIds() { | |||
| @@ -232,9 +234,9 @@ public class MallPermission implements Serializable { | |||
| sb.append(","); | |||
| sb.append(fields[k].toString()); | |||
| } | |||
| } | |||
| public void setSortColumns(String sortColumns) | |||
| { | |||
| if (sortColumns == null || "".equals(sortColumns.trim())) { | |||
| @@ -242,7 +244,7 @@ public class MallPermission implements Serializable { | |||
| } | |||
| if (sortColumns.contains(",")) { | |||
| String[] cols = sortColumns.split(","); | |||
| List<Field> fList = new ArrayList(); | |||
| java.util.List<Field> fList = new java.util.ArrayList(); | |||
| for (int k = 0; k < cols.length; k++) { | |||
| fList.add(Field.valueOf(cols[k])); | |||
| } | |||
| @@ -1,11 +1,12 @@ | |||
| package com.simple.domain.po; | |||
| import javax.persistence.Id; | |||
| import javax.persistence.Table; | |||
| import javax.persistence.*; | |||
| import java.util.*; | |||
| import java.math.*; | |||
| import javax.persistence.Transient; | |||
| import java.io.Serializable; | |||
| import java.util.ArrayList; | |||
| import java.util.List; | |||
| import javax.persistence.Id; | |||
| import java.io.Serializable; | |||
| @Table(name = "mall_role") | |||
| public class MallRole implements Serializable { | |||
| @@ -15,7 +16,7 @@ public class MallRole implements Serializable { | |||
| protected Long id; | |||
| @Transient | |||
| protected List<String> ids; | |||
| protected List<Long> ids; | |||
| @Transient | |||
| protected String sortColumns; | |||
| @@ -31,10 +32,11 @@ public class MallRole implements Serializable { | |||
| return sortColumns; | |||
| } | |||
| public List<String> getIds() { | |||
| public List<Long> getIds() { | |||
| return ids; | |||
| } | |||
| public void setIds(List<String> ids) { | |||
| public void setIds(List<Long> ids) { | |||
| this.ids = ids; | |||
| } | |||
| @@ -52,6 +54,18 @@ public class MallRole implements Serializable { | |||
| /*角色描述**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="角色描述",name="description") | |||
| private String description; | |||
| @Transient | |||
| private String menus; | |||
| public String getMenus() { | |||
| return menus; | |||
| } | |||
| public void setMenus(String menus) { | |||
| this.menus = menus; | |||
| } | |||
| public String getTenantId() { | |||
| return tenantId; | |||
| } | |||
| @@ -118,9 +132,9 @@ public class MallRole implements Serializable { | |||
| sb.append(","); | |||
| sb.append(fields[k].toString()); | |||
| } | |||
| } | |||
| public void setSortColumns(String sortColumns) | |||
| { | |||
| if (sortColumns == null || "".equals(sortColumns.trim())) { | |||
| @@ -128,7 +142,7 @@ public class MallRole implements Serializable { | |||
| } | |||
| if (sortColumns.contains(",")) { | |||
| String[] cols = sortColumns.split(","); | |||
| List<Field> fList = new ArrayList(); | |||
| java.util.List<Field> fList = new java.util.ArrayList(); | |||
| for (int k = 0; k < cols.length; k++) { | |||
| fList.add(Field.valueOf(cols[k])); | |||
| } | |||
| @@ -7,7 +7,7 @@ import java.io.Serializable; | |||
| import java.util.ArrayList; | |||
| import java.util.List; | |||
| @Table(name = "mall_user_role_permission") | |||
| @Table(name = "mall_role_permission") | |||
| public class MallRolePermission implements Serializable { | |||
| private static final long serialVersionUID = 1L; | |||
| @@ -65,12 +65,33 @@ public class MallUserInfo implements Serializable { | |||
| /*0 不是超管 1是超管**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="0 不是超管 1是超管",name="isAdmin") | |||
| private Integer isAdmin; | |||
| @Transient | |||
| private Long roleId; | |||
| //该用户所有的角色 | |||
| @Transient | |||
| private List<MallRole> role; | |||
| //该用户包含的所有权限 | |||
| @Transient | |||
| private List<MallPermission> permission; | |||
| //拥有的菜单权限 | |||
| private String menus; | |||
| public String getMenus() { | |||
| return menus; | |||
| } | |||
| public void setMenus(String menus) { | |||
| this.menus = menus; | |||
| } | |||
| public Long getRoleId() { | |||
| return roleId; | |||
| } | |||
| public void setRoleId(Long roleId) { | |||
| this.roleId = roleId; | |||
| } | |||
| public String getTenantId() { | |||
| return tenantId; | |||
| } | |||
| @@ -0,0 +1,182 @@ | |||
| package com.simple.domain.po; | |||
| import javax.persistence.*; | |||
| import java.util.*; | |||
| import java.math.*; | |||
| import javax.persistence.Transient; | |||
| import java.util.List; | |||
| import javax.persistence.Id; | |||
| import java.io.Serializable; | |||
| @Table(name = "push_limit") | |||
| public class PushLimit implements Serializable { | |||
| private static final long serialVersionUID = 1L; | |||
| @Id | |||
| protected Long id; | |||
| @Transient | |||
| protected List<Long> ids; | |||
| @Transient | |||
| protected String sortColumns; | |||
| public Long getId() { | |||
| return id; | |||
| } | |||
| public void setId(Long id) { | |||
| this.id = id; | |||
| } | |||
| public String getSortColumns() { | |||
| return sortColumns; | |||
| } | |||
| public List<Long> getIds() { | |||
| return ids; | |||
| } | |||
| public void setIds(List<Long> ids) { | |||
| this.ids = ids; | |||
| } | |||
| /***/ | |||
| @io.swagger.annotations.ApiModelProperty(value="",name="tenantId") | |||
| private String tenantId; | |||
| /*每人每天可接收短信数**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="每人每天可接收短信数",name="msgAmount") | |||
| private Integer msgAmount; | |||
| /*每人每周可接收发券数**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="每人每周可接收发券数",name="couponAmount") | |||
| private Integer couponAmount; | |||
| /*每人几天内,不会收到同一个券**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="每人几天内,不会收到同一个券",name="couponDay") | |||
| private Integer couponDay; | |||
| /*禁止发券,发短信开始时间**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="禁止发券,发短信开始时间",name="refuseTimeStart") | |||
| private String refuseTimeStart; | |||
| /*禁止发券,发短信结束时间**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="禁止发券,发短信结束时间",name="refuseTimeEnd") | |||
| private String refuseTimeEnd; | |||
| /***/ | |||
| @io.swagger.annotations.ApiModelProperty(value="",name="createTime") | |||
| private Date createTime; | |||
| /***/ | |||
| @io.swagger.annotations.ApiModelProperty(value="",name="updateTime") | |||
| private Date updateTime; | |||
| public String getTenantId() { | |||
| return tenantId; | |||
| } | |||
| public void setTenantId(String _tenantId) { | |||
| tenantId = _tenantId; | |||
| } | |||
| public Integer getMsgAmount() { | |||
| return msgAmount; | |||
| } | |||
| public void setMsgAmount(Integer _msgAmount) { | |||
| msgAmount = _msgAmount; | |||
| } | |||
| public Integer getCouponAmount() { | |||
| return couponAmount; | |||
| } | |||
| public void setCouponAmount(Integer _couponAmount) { | |||
| couponAmount = _couponAmount; | |||
| } | |||
| public Integer getCouponDay() { | |||
| return couponDay; | |||
| } | |||
| public void setCouponDay(Integer _couponDay) { | |||
| couponDay = _couponDay; | |||
| } | |||
| public String getRefuseTimeStart() { | |||
| return refuseTimeStart; | |||
| } | |||
| public void setRefuseTimeStart(String _refuseTimeStart) { | |||
| refuseTimeStart = _refuseTimeStart; | |||
| } | |||
| public String getRefuseTimeEnd() { | |||
| return refuseTimeEnd; | |||
| } | |||
| public void setRefuseTimeEnd(String _refuseTimeEnd) { | |||
| refuseTimeEnd = _refuseTimeEnd; | |||
| } | |||
| public Date getCreateTime() { | |||
| return createTime; | |||
| } | |||
| public void setCreateTime(Date _createTime) { | |||
| createTime = _createTime; | |||
| } | |||
| public Date getUpdateTime() { | |||
| return updateTime; | |||
| } | |||
| public void setUpdateTime(Date _updateTime) { | |||
| updateTime = _updateTime; | |||
| } | |||
| public static enum Field | |||
| { | |||
| Id_ASC("`id` ASC"),Id_DESC("`id` DESC") | |||
| ,TenantId_ASC("`tenantId` ASC"),TenantId_DESC("`tenantId` DESC") | |||
| ,MsgAmount_ASC("`msgAmount` ASC"),MsgAmount_DESC("`msgAmount` DESC") | |||
| ,CouponAmount_ASC("`couponAmount` ASC"),CouponAmount_DESC("`couponAmount` DESC") | |||
| ,CouponDay_ASC("`couponDay` ASC"),CouponDay_DESC("`couponDay` DESC") | |||
| ,RefuseTimeStart_ASC("`refuseTimeStart` ASC"),RefuseTimeStart_DESC("`refuseTimeStart` DESC") | |||
| ,RefuseTimeEnd_ASC("`refuseTimeEnd` ASC"),RefuseTimeEnd_DESC("`refuseTimeEnd` DESC") | |||
| ,CreateTime_ASC("`createTime` ASC"),CreateTime_DESC("`createTime` DESC") | |||
| ,UpdateTime_ASC("`updateTime` ASC"),UpdateTime_DESC("`updateTime` DESC") | |||
| ; | |||
| private String value; | |||
| Field(String value){ | |||
| this.value = value; | |||
| } | |||
| public String getValue() { | |||
| return value; | |||
| } | |||
| public void setCol(String value) { | |||
| this.value = value; | |||
| } | |||
| @Override | |||
| public String toString() { | |||
| return this.getValue(); | |||
| } | |||
| } | |||
| public void setSortColumns(PushLimit.Field... fields) | |||
| { | |||
| if (fields == null || fields.length == 0) { | |||
| return; | |||
| } | |||
| for (int k = 0; k < fields.length; k++) { | |||
| if (fields[k] == null) { | |||
| return; | |||
| } | |||
| } | |||
| StringBuilder sb = new StringBuilder(fields[0].toString()); | |||
| for (int k = 1; k < fields.length; k++) { | |||
| sb.append(","); | |||
| sb.append(fields[k].toString()); | |||
| } | |||
| } | |||
| public void setSortColumns(String sortColumns) | |||
| { | |||
| if (sortColumns == null || "".equals(sortColumns.trim())) { | |||
| return; | |||
| } | |||
| if (sortColumns.contains(",")) { | |||
| String[] cols = sortColumns.split(","); | |||
| java.util.List<Field> fList = new java.util.ArrayList(); | |||
| for (int k = 0; k < cols.length; k++) { | |||
| fList.add(Field.valueOf(cols[k])); | |||
| } | |||
| this.setSortColumns(fList.toArray(new Field[fList.size()])); | |||
| } else { | |||
| this.setSortColumns(Field.valueOf(sortColumns)); | |||
| } | |||
| } | |||
| } | |||
| @@ -0,0 +1,152 @@ | |||
| package com.simple.domain.po; | |||
| import javax.persistence.*; | |||
| import java.util.*; | |||
| import java.math.*; | |||
| import javax.persistence.Transient; | |||
| import java.util.List; | |||
| import javax.persistence.Id; | |||
| import java.io.Serializable; | |||
| @Table(name = "wx_admin_log") | |||
| public class WxAdminLog implements Serializable { | |||
| private static final long serialVersionUID = 1L; | |||
| @Id | |||
| protected Long id; | |||
| @Transient | |||
| protected List<Long> ids; | |||
| @Transient | |||
| protected String sortColumns; | |||
| public Long getId() { | |||
| return id; | |||
| } | |||
| public void setId(Long id) { | |||
| this.id = id; | |||
| } | |||
| public String getSortColumns() { | |||
| return sortColumns; | |||
| } | |||
| public List<Long> getIds() { | |||
| return ids; | |||
| } | |||
| public void setIds(List<Long> ids) { | |||
| this.ids = ids; | |||
| } | |||
| /*租户ID**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="租户ID",name="tenantId") | |||
| private String tenantId; | |||
| /*网址**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="网址",name="url") | |||
| private String url; | |||
| /*时间**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="时间",name="actionDate") | |||
| private String actionDate; | |||
| /*1. pv 2. uv**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="1. pv 2. uv",name="type") | |||
| private Integer type; | |||
| /*计数**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="计数",name="count") | |||
| private Integer count; | |||
| public String getTenantId() { | |||
| return tenantId; | |||
| } | |||
| public void setTenantId(String _tenantId) { | |||
| tenantId = _tenantId; | |||
| } | |||
| public String getUrl() { | |||
| return url; | |||
| } | |||
| public void setUrl(String _url) { | |||
| url = _url; | |||
| } | |||
| public String getActionDate() { | |||
| return actionDate; | |||
| } | |||
| public void setActionDate(String _actionDate) { | |||
| actionDate = _actionDate; | |||
| } | |||
| public Integer getType() { | |||
| return type; | |||
| } | |||
| public void setType(Integer _type) { | |||
| type = _type; | |||
| } | |||
| public Integer getCount() { | |||
| return count; | |||
| } | |||
| public void setCount(Integer _count) { | |||
| count = _count; | |||
| } | |||
| public static enum Field | |||
| { | |||
| Id_ASC("`id` ASC"),Id_DESC("`id` DESC") | |||
| ,TenantId_ASC("`tenantId` ASC"),TenantId_DESC("`tenantId` DESC") | |||
| ,Url_ASC("`url` ASC"),Url_DESC("`url` DESC") | |||
| ,ActionDate_ASC("`actionDate` ASC"),ActionDate_DESC("`actionDate` DESC") | |||
| ,Type_ASC("`type` ASC"),Type_DESC("`type` DESC") | |||
| ,Count_ASC("`count` ASC"),Count_DESC("`count` DESC") | |||
| ; | |||
| private String value; | |||
| Field(String value){ | |||
| this.value = value; | |||
| } | |||
| public String getValue() { | |||
| return value; | |||
| } | |||
| public void setCol(String value) { | |||
| this.value = value; | |||
| } | |||
| @Override | |||
| public String toString() { | |||
| return this.getValue(); | |||
| } | |||
| } | |||
| public void setSortColumns(WxAdminLog.Field... fields) | |||
| { | |||
| if (fields == null || fields.length == 0) { | |||
| return; | |||
| } | |||
| for (int k = 0; k < fields.length; k++) { | |||
| if (fields[k] == null) { | |||
| return; | |||
| } | |||
| } | |||
| StringBuilder sb = new StringBuilder(fields[0].toString()); | |||
| for (int k = 1; k < fields.length; k++) { | |||
| sb.append(","); | |||
| sb.append(fields[k].toString()); | |||
| } | |||
| } | |||
| public void setSortColumns(String sortColumns) | |||
| { | |||
| if (sortColumns == null || "".equals(sortColumns.trim())) { | |||
| return; | |||
| } | |||
| if (sortColumns.contains(",")) { | |||
| String[] cols = sortColumns.split(","); | |||
| java.util.List<Field> fList = new java.util.ArrayList(); | |||
| for (int k = 0; k < cols.length; k++) { | |||
| fList.add(Field.valueOf(cols[k])); | |||
| } | |||
| this.setSortColumns(fList.toArray(new Field[fList.size()])); | |||
| } else { | |||
| this.setSortColumns(Field.valueOf(sortColumns)); | |||
| } | |||
| } | |||
| } | |||
| @@ -1,191 +0,0 @@ | |||
| package com.simple.domain.po; | |||
| import javax.persistence.*; | |||
| import java.util.*; | |||
| import java.math.*; | |||
| import javax.persistence.Transient; | |||
| import java.util.List; | |||
| import javax.persistence.Id; | |||
| import java.io.Serializable; | |||
| @Table(name = "wx_banners") | |||
| public class WxBanners implements Serializable { | |||
| private static final long serialVersionUID = 1L; | |||
| @Id | |||
| protected Long id; | |||
| @Transient | |||
| protected List<String> ids; | |||
| @Transient | |||
| protected String sortColumns; | |||
| public Long getId() { | |||
| return id; | |||
| } | |||
| public void setId(Long id) { | |||
| this.id = id; | |||
| } | |||
| public String getSortColumns() { | |||
| return sortColumns; | |||
| } | |||
| public List<String> getIds() { | |||
| return ids; | |||
| } | |||
| public void setIds(List<String> ids) { | |||
| this.ids = ids; | |||
| } | |||
| /*租户ID**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="租户ID",name="tenantId") | |||
| private String tenantId; | |||
| /*封面图**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="封面图",name="facePicUrl") | |||
| private String facePicUrl; | |||
| /*活动类型 1h5页面2视频**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="活动类型 1h5页面2视频",name="activityType") | |||
| private Integer activityType; | |||
| /*链接**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="链接",name="url") | |||
| private String url; | |||
| /*排序**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="排序",name="sortNum") | |||
| private Integer sortNum; | |||
| /*创建时间**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="创建时间",name="createtime") | |||
| private Date createtime; | |||
| /*上线时间**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="上线时间",name="uptime") | |||
| private Date uptime; | |||
| /*说明**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="说明",name="desc") | |||
| private String desc; | |||
| /*状态 1启用 2停用**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="状态 1启用 2停用",name="isEnable") | |||
| private Integer isEnable; | |||
| public String getTenantId() { | |||
| return tenantId; | |||
| } | |||
| public void setTenantId(String _tenantId) { | |||
| tenantId = _tenantId; | |||
| } | |||
| public String getFacePicUrl() { | |||
| return facePicUrl; | |||
| } | |||
| public void setFacePicUrl(String _facePicUrl) { | |||
| facePicUrl = _facePicUrl; | |||
| } | |||
| public Integer getActivityType() { | |||
| return activityType; | |||
| } | |||
| public void setActivityType(Integer _activityType) { | |||
| activityType = _activityType; | |||
| } | |||
| public String getUrl() { | |||
| return url; | |||
| } | |||
| public void setUrl(String _url) { | |||
| url = _url; | |||
| } | |||
| public Integer getSortNum() { | |||
| return sortNum; | |||
| } | |||
| public void setSortNum(Integer _sortNum) { | |||
| sortNum = _sortNum; | |||
| } | |||
| public Date getCreatetime() { | |||
| return createtime; | |||
| } | |||
| public void setCreatetime(Date _createtime) { | |||
| createtime = _createtime; | |||
| } | |||
| public Date getUptime() { | |||
| return uptime; | |||
| } | |||
| public void setUptime(Date _uptime) { | |||
| uptime = _uptime; | |||
| } | |||
| public String getDesc() { | |||
| return desc; | |||
| } | |||
| public void setDesc(String _desc) { | |||
| desc = _desc; | |||
| } | |||
| public Integer getIsEnable() { | |||
| return isEnable; | |||
| } | |||
| public void setIsEnable(Integer _isEnable) { | |||
| isEnable = _isEnable; | |||
| } | |||
| public static enum Field | |||
| { | |||
| Id_ASC("`id` ASC"),Id_DESC("`id` DESC") | |||
| ,TenantId_ASC("`tenantId` ASC"),TenantId_DESC("`tenantId` DESC") | |||
| ,FacePicUrl_ASC("`facePicUrl` ASC"),FacePicUrl_DESC("`facePicUrl` DESC") | |||
| ,ActivityType_ASC("`activityType` ASC"),ActivityType_DESC("`activityType` DESC") | |||
| ,Url_ASC("`url` ASC"),Url_DESC("`url` DESC") | |||
| ,SortNum_ASC("`sortNum` ASC"),SortNum_DESC("`sortNum` DESC") | |||
| ,Createtime_ASC("`createtime` ASC"),Createtime_DESC("`createtime` DESC") | |||
| ,Uptime_ASC("`uptime` ASC"),Uptime_DESC("`uptime` DESC") | |||
| ,Desc_ASC("`desc` ASC"),Desc_DESC("`desc` DESC") | |||
| ,IsEnable_ASC("`isEnable` ASC"),IsEnable_DESC("`isEnable` DESC") | |||
| ; | |||
| private String value; | |||
| Field(String value){ | |||
| this.value = value; | |||
| } | |||
| public String getValue() { | |||
| return value; | |||
| } | |||
| public void setCol(String value) { | |||
| this.value = value; | |||
| } | |||
| @Override | |||
| public String toString() { | |||
| return this.getValue(); | |||
| } | |||
| } | |||
| public void setSortColumns(WxBanners.Field... fields) | |||
| { | |||
| if (fields == null || fields.length == 0) { | |||
| return; | |||
| } | |||
| for (int k = 0; k < fields.length; k++) { | |||
| if (fields[k] == null) { | |||
| return; | |||
| } | |||
| } | |||
| StringBuilder sb = new StringBuilder(fields[0].toString()); | |||
| for (int k = 1; k < fields.length; k++) { | |||
| sb.append(","); | |||
| sb.append(fields[k].toString()); | |||
| } | |||
| } | |||
| public void setSortColumns(String sortColumns) | |||
| { | |||
| if (sortColumns == null || "".equals(sortColumns.trim())) { | |||
| return; | |||
| } | |||
| if (sortColumns.contains(",")) { | |||
| String[] cols = sortColumns.split(","); | |||
| java.util.List<Field> fList = new java.util.ArrayList(); | |||
| for (int k = 0; k < cols.length; k++) { | |||
| fList.add(Field.valueOf(cols[k])); | |||
| } | |||
| this.setSortColumns(fList.toArray(new Field[fList.size()])); | |||
| } else { | |||
| this.setSortColumns(Field.valueOf(sortColumns)); | |||
| } | |||
| } | |||
| } | |||
| @@ -82,6 +82,14 @@ public class WxCUserBasicInfo implements Serializable { | |||
| /*用户姓名**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="用户姓名",name="name") | |||
| private String name; | |||
| /*会员等级**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="会员等级",name="level") | |||
| private String level; | |||
| /*用户昵称**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="用户昵称",name="nickName") | |||
| private String nickName; | |||
| @Transient | |||
| private String tagIds; | |||
| @Transient | |||
| @@ -89,6 +97,22 @@ public class WxCUserBasicInfo implements Serializable { | |||
| @Transient | |||
| private long count; | |||
| public String getLevel() { | |||
| return level; | |||
| } | |||
| public void setLevel(String level) { | |||
| this.level = level; | |||
| } | |||
| public String getNickName() { | |||
| return nickName; | |||
| } | |||
| public void setNickName(String nickName) { | |||
| this.nickName = nickName; | |||
| } | |||
| public long getCount() { | |||
| return count; | |||
| } | |||
| @@ -1,201 +0,0 @@ | |||
| package com.simple.domain.po; | |||
| import javax.persistence.*; | |||
| import java.util.*; | |||
| import java.math.*; | |||
| import javax.persistence.Transient; | |||
| import java.util.List; | |||
| import javax.persistence.Id; | |||
| import java.io.Serializable; | |||
| @Table(name = "wx_coupon_verify") | |||
| public class WxCouponVerify implements Serializable { | |||
| private static final long serialVersionUID = 1L; | |||
| @Id | |||
| protected Long id; | |||
| @Transient | |||
| protected List<String> ids; | |||
| @Transient | |||
| protected String sortColumns; | |||
| public Long getId() { | |||
| return id; | |||
| } | |||
| public void setId(Long id) { | |||
| this.id = id; | |||
| } | |||
| public String getSortColumns() { | |||
| return sortColumns; | |||
| } | |||
| public List<String> getIds() { | |||
| return ids; | |||
| } | |||
| public void setIds(List<String> ids) { | |||
| this.ids = ids; | |||
| } | |||
| /*租户ID**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="租户ID",name="tenantId") | |||
| private String tenantId; | |||
| /*coupon id**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="coupon id",name="couponId") | |||
| private Long couponId; | |||
| /*订单id**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="订单id",name="orderId") | |||
| private Long orderId; | |||
| /*c端用户id**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="c端用户id",name="cUserId") | |||
| private Long cUserId; | |||
| /*购买日期/领取日期**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="购买日期/领取日期",name="buyDate") | |||
| private Date buyDate; | |||
| /*截止日期**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="截止日期",name="limitDate") | |||
| private Date limitDate; | |||
| /*c状态(0:default,1:未支付,2:已支付/已领取,3:已使用,4:已退回/已退券)**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="c状态(0:default,1:未支付,2:已支付/已领取,3:已使用,4:已退回/已退券)",name="cStatus") | |||
| private Integer cStatus; | |||
| /*b端用户id**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="b端用户id",name="bUserId") | |||
| private Long bUserId; | |||
| /*核销日期**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="核销日期",name="verificationDate") | |||
| private Date verificationDate; | |||
| /*核销状态(0:未核销,1:已核销)**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="核销状态(0:未核销,1:已核销)",name="verificationStatus") | |||
| private Integer verificationStatus; | |||
| public String getTenantId() { | |||
| return tenantId; | |||
| } | |||
| public void setTenantId(String _tenantId) { | |||
| tenantId = _tenantId; | |||
| } | |||
| public Long getCouponId() { | |||
| return couponId; | |||
| } | |||
| public void setCouponId(Long _couponId) { | |||
| couponId = _couponId; | |||
| } | |||
| public Long getOrderId() { | |||
| return orderId; | |||
| } | |||
| public void setOrderId(Long _orderId) { | |||
| orderId = _orderId; | |||
| } | |||
| public Long getCUserId() { | |||
| return cUserId; | |||
| } | |||
| public void setCUserId(Long _cUserId) { | |||
| cUserId = _cUserId; | |||
| } | |||
| public Date getBuyDate() { | |||
| return buyDate; | |||
| } | |||
| public void setBuyDate(Date _buyDate) { | |||
| buyDate = _buyDate; | |||
| } | |||
| public Date getLimitDate() { | |||
| return limitDate; | |||
| } | |||
| public void setLimitDate(Date _limitDate) { | |||
| limitDate = _limitDate; | |||
| } | |||
| public Integer getCStatus() { | |||
| return cStatus; | |||
| } | |||
| public void setCStatus(Integer _cStatus) { | |||
| cStatus = _cStatus; | |||
| } | |||
| public Long getBUserId() { | |||
| return bUserId; | |||
| } | |||
| public void setBUserId(Long _bUserId) { | |||
| bUserId = _bUserId; | |||
| } | |||
| public Date getVerificationDate() { | |||
| return verificationDate; | |||
| } | |||
| public void setVerificationDate(Date _verificationDate) { | |||
| verificationDate = _verificationDate; | |||
| } | |||
| public Integer getVerificationStatus() { | |||
| return verificationStatus; | |||
| } | |||
| public void setVerificationStatus(Integer _verificationStatus) { | |||
| verificationStatus = _verificationStatus; | |||
| } | |||
| public static enum Field | |||
| { | |||
| Id_ASC("`id` ASC"),Id_DESC("`id` DESC") | |||
| ,TenantId_ASC("`tenantId` ASC"),TenantId_DESC("`tenantId` DESC") | |||
| ,CouponId_ASC("`couponId` ASC"),CouponId_DESC("`couponId` DESC") | |||
| ,OrderId_ASC("`orderId` ASC"),OrderId_DESC("`orderId` DESC") | |||
| ,CUserId_ASC("`cUserId` ASC"),CUserId_DESC("`cUserId` DESC") | |||
| ,BuyDate_ASC("`buyDate` ASC"),BuyDate_DESC("`buyDate` DESC") | |||
| ,LimitDate_ASC("`limitDate` ASC"),LimitDate_DESC("`limitDate` DESC") | |||
| ,CStatus_ASC("`cStatus` ASC"),CStatus_DESC("`cStatus` DESC") | |||
| ,BUserId_ASC("`bUserId` ASC"),BUserId_DESC("`bUserId` DESC") | |||
| ,VerificationDate_ASC("`verificationDate` ASC"),VerificationDate_DESC("`verificationDate` DESC") | |||
| ,VerificationStatus_ASC("`verificationStatus` ASC"),VerificationStatus_DESC("`verificationStatus` DESC") | |||
| ; | |||
| private String value; | |||
| Field(String value){ | |||
| this.value = value; | |||
| } | |||
| public String getValue() { | |||
| return value; | |||
| } | |||
| public void setCol(String value) { | |||
| this.value = value; | |||
| } | |||
| @Override | |||
| public String toString() { | |||
| return this.getValue(); | |||
| } | |||
| } | |||
| public void setSortColumns(WxCouponVerify.Field... fields) | |||
| { | |||
| if (fields == null || fields.length == 0) { | |||
| return; | |||
| } | |||
| for (int k = 0; k < fields.length; k++) { | |||
| if (fields[k] == null) { | |||
| return; | |||
| } | |||
| } | |||
| StringBuilder sb = new StringBuilder(fields[0].toString()); | |||
| for (int k = 1; k < fields.length; k++) { | |||
| sb.append(","); | |||
| sb.append(fields[k].toString()); | |||
| } | |||
| } | |||
| public void setSortColumns(String sortColumns) | |||
| { | |||
| if (sortColumns == null || "".equals(sortColumns.trim())) { | |||
| return; | |||
| } | |||
| if (sortColumns.contains(",")) { | |||
| String[] cols = sortColumns.split(","); | |||
| java.util.List<Field> fList = new java.util.ArrayList(); | |||
| for (int k = 0; k < cols.length; k++) { | |||
| fList.add(Field.valueOf(cols[k])); | |||
| } | |||
| this.setSortColumns(fList.toArray(new Field[fList.size()])); | |||
| } else { | |||
| this.setSortColumns(Field.valueOf(sortColumns)); | |||
| } | |||
| } | |||
| } | |||
| @@ -8,15 +8,15 @@ import java.util.List; | |||
| import javax.persistence.Id; | |||
| import java.io.Serializable; | |||
| @Table(name = "wx_web_log") | |||
| public class WxWebLog implements Serializable { | |||
| @Table(name = "wx_level_config") | |||
| public class WxLevelConfig implements Serializable { | |||
| private static final long serialVersionUID = 1L; | |||
| @Id | |||
| protected Long id; | |||
| @Transient | |||
| protected List<String> ids; | |||
| protected List<Long> ids; | |||
| @Transient | |||
| protected String sortColumns; | |||
| @@ -32,35 +32,48 @@ public class WxWebLog implements Serializable { | |||
| return sortColumns; | |||
| } | |||
| public List<String> getIds() { | |||
| public List<Long> getIds() { | |||
| return ids; | |||
| } | |||
| public void setIds(List<String> ids) { | |||
| public void setIds(List<Long> ids) { | |||
| this.ids = ids; | |||
| } | |||
| /*租户ID**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="租户ID",name="tenantId") | |||
| private String tenantId; | |||
| /***/ | |||
| @io.swagger.annotations.ApiModelProperty(value="",name="data") | |||
| private String data; | |||
| /*成长值**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="成长值",name="points") | |||
| private Integer points; | |||
| /*等级**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="等级",name="level") | |||
| private String level; | |||
| /*描述**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="描述",name="description") | |||
| private String description; | |||
| /*创建时间**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="创建时间",name="createDate") | |||
| private Date createDate; | |||
| public String getTenantId() { | |||
| return tenantId; | |||
| /*租户id**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="租户id",name="tenantId") | |||
| private String tenantId; | |||
| public Integer getPoints() { | |||
| return points; | |||
| } | |||
| public void setTenantId(String _tenantId) { | |||
| tenantId = _tenantId; | |||
| public void setPoints(Integer _points) { | |||
| points = _points; | |||
| } | |||
| public String getLevel() { | |||
| return level; | |||
| } | |||
| public void setLevel(String _level) { | |||
| level = _level; | |||
| } | |||
| public String getData() { | |||
| return data; | |||
| public String getDescription() { | |||
| return description; | |||
| } | |||
| public void setData(String _data) { | |||
| data = _data; | |||
| public void setDescription(String _description) { | |||
| description = _description; | |||
| } | |||
| public Date getCreateDate() { | |||
| return createDate; | |||
| @@ -68,15 +81,23 @@ public class WxWebLog implements Serializable { | |||
| public void setCreateDate(Date _createDate) { | |||
| createDate = _createDate; | |||
| } | |||
| public String getTenantId() { | |||
| return tenantId; | |||
| } | |||
| public void setTenantId(String _tenantId) { | |||
| tenantId = _tenantId; | |||
| } | |||
| public static enum Field | |||
| { | |||
| Id_ASC("`id` ASC"),Id_DESC("`id` DESC") | |||
| ,TenantId_ASC("`tenantId` ASC"),TenantId_DESC("`tenantId` DESC") | |||
| ,Data_ASC("`data` ASC"),Data_DESC("`data` DESC") | |||
| ,Points_ASC("`points` ASC"),Points_DESC("`points` DESC") | |||
| ,Level_ASC("`level` ASC"),Level_DESC("`level` DESC") | |||
| ,Description_ASC("`description` ASC"),Description_DESC("`description` DESC") | |||
| ,CreateDate_ASC("`createDate` ASC"),CreateDate_DESC("`createDate` DESC") | |||
| ,TenantId_ASC("`tenantId` ASC"),TenantId_DESC("`tenantId` DESC") | |||
| ; | |||
| private String value; | |||
| Field(String value){ | |||
| @@ -94,7 +115,7 @@ public class WxWebLog implements Serializable { | |||
| } | |||
| } | |||
| public void setSortColumns(WxWebLog.Field... fields) | |||
| public void setSortColumns(WxLevelConfig.Field... fields) | |||
| { | |||
| if (fields == null || fields.length == 0) { | |||
| return; | |||
| @@ -82,7 +82,7 @@ public class WxMerchant implements Serializable { | |||
| /*停车厂商参数**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="停车厂商参数",name="carParams") | |||
| private String carParams; | |||
| /*商户状态**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="状态1可用0停用",name="status") | |||
| private Integer status; | |||
| @@ -73,11 +73,11 @@ public class WxMerchantBUser implements Serializable { | |||
| /*用户过期时间**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="用户过期时间",name="expireTime") | |||
| private Date expireTime; | |||
| @io.swagger.annotations.ApiModelProperty(value="name",name="name") | |||
| /*b端用户姓名**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="b端用户姓名",name="name") | |||
| private String name; | |||
| @io.swagger.annotations.ApiModelProperty(value="删除状态1删除0未删除",name="status") | |||
| /*绑定状态1未绑定商户0已绑定商户**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="绑定状态1未绑定商户0已绑定商户",name="status") | |||
| private Integer status; | |||
| @@ -54,6 +54,9 @@ public class WxPark implements Serializable { | |||
| /*出入口数量**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="出入口数量",name="entryExit") | |||
| private Integer entryExit; | |||
| /*停车费**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="停车费",name="stopFee") | |||
| private String stopFee; | |||
| /*创建时间**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="创建时间",name="createDate") | |||
| private Date createDate; | |||
| @@ -93,6 +96,15 @@ public class WxPark implements Serializable { | |||
| public void setEntryExit(Integer _entryExit) { | |||
| entryExit = _entryExit; | |||
| } | |||
| public String getStopFee() { | |||
| return stopFee; | |||
| } | |||
| public void setStopFee(String _stopFee) { | |||
| this.stopFee = _stopFee; | |||
| } | |||
| public Date getCreateDate() { | |||
| return createDate; | |||
| } | |||
| @@ -124,8 +136,6 @@ public class WxPark implements Serializable { | |||
| vendorParams = _vendorParams; | |||
| } | |||
| public static enum Field | |||
| { | |||
| Id_ASC("`id` ASC"),Id_DESC("`id` DESC") | |||
| @@ -133,6 +143,7 @@ public class WxPark implements Serializable { | |||
| ,Addr_ASC("`addr` ASC"),Addr_DESC("`addr` DESC") | |||
| ,Number_ASC("`number` ASC"),Number_DESC("`number` DESC") | |||
| ,EntryExit_ASC("`entryExit` ASC"),EntryExit_DESC("`entryExit` DESC") | |||
| ,StopFee_ASC("`stopFee` ASC"),StopFee_DESC("`stopFee` DESC") | |||
| ,CreateDate_ASC("`createDate` ASC"),CreateDate_DESC("`createDate` DESC") | |||
| ,UpdateDate_ASC("`updateDate` ASC"),UpdateDate_DESC("`updateDate` DESC") | |||
| ,ParkId_ASC("`parkId` ASC"),ParkId_DESC("`parkId` DESC") | |||
| @@ -16,7 +16,7 @@ public class WxScoreRules implements Serializable { | |||
| protected Long id; | |||
| @Transient | |||
| protected List<String> ids; | |||
| protected List<Long> ids; | |||
| @Transient | |||
| protected String sortColumns; | |||
| @@ -32,10 +32,11 @@ public class WxScoreRules implements Serializable { | |||
| return sortColumns; | |||
| } | |||
| public List<String> getIds() { | |||
| public List<Long> getIds() { | |||
| return ids; | |||
| } | |||
| public void setIds(List<String> ids) { | |||
| public void setIds(List<Long> ids) { | |||
| this.ids = ids; | |||
| } | |||
| @@ -46,33 +47,39 @@ public class WxScoreRules implements Serializable { | |||
| private String tenantId; | |||
| /*消费金额**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="消费金额",name="consumptionAmount") | |||
| private BigDecimal consumptionAmount; | |||
| /*获取积分**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="获取积分",name="scoreNumber") | |||
| private Integer scoreNumber; | |||
| private Integer consumptionAmount; | |||
| /*登录获取积分**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="登录获取积分",name="loginScoreNumber") | |||
| private Integer loginScoreNumber; | |||
| /*创建时间**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="创建时间",name="createDate") | |||
| private Date createDate; | |||
| /*更新时间**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="更新时间",name="updateDate") | |||
| private Date updateDate; | |||
| /*登录次数**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="登录次数",name="loginCount") | |||
| private Integer loginCount; | |||
| /*消费获取积分**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="消费获取积分",name="consumptionScoreNumber") | |||
| private Integer consumptionScoreNumber; | |||
| public String getTenantId() { | |||
| return tenantId; | |||
| } | |||
| public void setTenantId(String _tenantId) { | |||
| tenantId = _tenantId; | |||
| } | |||
| public BigDecimal getConsumptionAmount() { | |||
| public Integer getConsumptionAmount() { | |||
| return consumptionAmount; | |||
| } | |||
| public void setConsumptionAmount(BigDecimal _consumptionAmount) { | |||
| public void setConsumptionAmount(Integer _consumptionAmount) { | |||
| consumptionAmount = _consumptionAmount; | |||
| } | |||
| public Integer getScoreNumber() { | |||
| return scoreNumber; | |||
| public Integer getLoginScoreNumber() { | |||
| return loginScoreNumber; | |||
| } | |||
| public void setScoreNumber(Integer _scoreNumber) { | |||
| scoreNumber = _scoreNumber; | |||
| public void setLoginScoreNumber(Integer _loginScoreNumber) { | |||
| loginScoreNumber = _loginScoreNumber; | |||
| } | |||
| public Date getCreateDate() { | |||
| return createDate; | |||
| @@ -86,6 +93,18 @@ public class WxScoreRules implements Serializable { | |||
| public void setUpdateDate(Date _updateDate) { | |||
| updateDate = _updateDate; | |||
| } | |||
| public Integer getLoginCount() { | |||
| return loginCount; | |||
| } | |||
| public void setLoginCount(Integer _loginCount) { | |||
| loginCount = _loginCount; | |||
| } | |||
| public Integer getConsumptionScoreNumber() { | |||
| return consumptionScoreNumber; | |||
| } | |||
| public void setConsumptionScoreNumber(Integer _consumptionScoreNumber) { | |||
| consumptionScoreNumber = _consumptionScoreNumber; | |||
| } | |||
| @@ -94,9 +113,11 @@ public class WxScoreRules implements Serializable { | |||
| Id_ASC("`id` ASC"),Id_DESC("`id` DESC") | |||
| ,TenantId_ASC("`tenantId` ASC"),TenantId_DESC("`tenantId` DESC") | |||
| ,ConsumptionAmount_ASC("`consumptionAmount` ASC"),ConsumptionAmount_DESC("`consumptionAmount` DESC") | |||
| ,ScoreNumber_ASC("`scoreNumber` ASC"),ScoreNumber_DESC("`scoreNumber` DESC") | |||
| ,LoginScoreNumber_ASC("`loginScoreNumber` ASC"),LoginScoreNumber_DESC("`loginScoreNumber` DESC") | |||
| ,CreateDate_ASC("`createDate` ASC"),CreateDate_DESC("`createDate` DESC") | |||
| ,UpdateDate_ASC("`updateDate` ASC"),UpdateDate_DESC("`updateDate` DESC") | |||
| ,LoginCount_ASC("`loginCount` ASC"),LoginCount_DESC("`loginCount` DESC") | |||
| ,ConsumptionScoreNumber_ASC("`consumptionScoreNumber` ASC"),ConsumptionScoreNumber_DESC("`consumptionScoreNumber` DESC") | |||
| ; | |||
| private String value; | |||
| Field(String value){ | |||
| @@ -55,10 +55,10 @@ public class WxShop implements Serializable { | |||
| private String operationArea; | |||
| /*楼座号**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="楼座号",name="building") | |||
| private String building; | |||
| private Long building; | |||
| /*楼层号**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="楼层号",name="floor") | |||
| private Integer floor; | |||
| private Long floor; | |||
| /*状态(0:未出租, 1:已出租)**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="状态(0:未出租, 1:已出租)",name="status") | |||
| private Integer status; | |||
| @@ -114,16 +114,16 @@ public class WxShop implements Serializable { | |||
| public void setOperationArea(String _operationArea) { | |||
| operationArea = _operationArea; | |||
| } | |||
| public String getBuilding() { | |||
| public Long getBuilding() { | |||
| return building; | |||
| } | |||
| public void setBuilding(String _building) { | |||
| public void setBuilding(Long _building) { | |||
| building = _building; | |||
| } | |||
| public Integer getFloor() { | |||
| public Long getFloor() { | |||
| return floor; | |||
| } | |||
| public void setFloor(Integer _floor) { | |||
| public void setFloor(Long _floor) { | |||
| floor = _floor; | |||
| } | |||
| public Integer getStatus() { | |||
| @@ -1,45 +0,0 @@ | |||
| package com.simple.domain.vo; | |||
| import java.io.Serializable; | |||
| public class CouponListReq implements Serializable { | |||
| private static final long serialVersionUID = 1L; | |||
| /*租户ID**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="租户ID",name="tenantId") | |||
| private String tenantId; | |||
| /*卡券ID**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="卡券ID",name="couponId") | |||
| private Long couponId; | |||
| /*商户ID**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="商户ID",name="merchantId") | |||
| private Long merchantId; | |||
| /*业态**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="业态",name="businessId") | |||
| private Long businessId; | |||
| public String getTenantId() { | |||
| return tenantId; | |||
| } | |||
| public void setTenantId(String _tenantId) { | |||
| tenantId = _tenantId; | |||
| } | |||
| public Long getCouponId() { | |||
| return couponId; | |||
| } | |||
| public void setCouponId(Long _couponId) { | |||
| couponId = _couponId; | |||
| } | |||
| public Long getMerchantId() { | |||
| return merchantId; | |||
| } | |||
| public void setMerchantId(Long _merchantId) { | |||
| merchantId = _merchantId; | |||
| } | |||
| public Long getBusinessId() { | |||
| return businessId; | |||
| } | |||
| public void setBusinessId(Long businessId) { | |||
| this.businessId = businessId; | |||
| } | |||
| } | |||
| @@ -0,0 +1,495 @@ | |||
| package com.simple.domain.vo; | |||
| import com.simple.domain.po.WxCoupon; | |||
| import javax.persistence.Id; | |||
| import javax.persistence.Transient; | |||
| import java.io.Serializable; | |||
| import java.text.DecimalFormat; | |||
| import java.util.Date; | |||
| import java.util.List; | |||
| public class WxCouponCVo implements Serializable { | |||
| private static final long serialVersionUID = 1L; | |||
| @Id | |||
| protected Long id; | |||
| @Transient | |||
| protected List<Long> ids; | |||
| @Transient | |||
| protected String sortColumns; | |||
| public Long getId() { | |||
| return id; | |||
| } | |||
| public void setId(Long id) { | |||
| this.id = id; | |||
| } | |||
| public String getSortColumns() { | |||
| return sortColumns; | |||
| } | |||
| public List<Long> getIds() { | |||
| return ids; | |||
| } | |||
| public void setIds(List<Long> ids) { | |||
| this.ids = ids; | |||
| } | |||
| @Transient | |||
| private String salePriceStr; | |||
| @Transient | |||
| private String usePriceStr; | |||
| @Transient | |||
| private String priceStr; | |||
| /*租户ID**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="租户ID",name="tenantId") | |||
| private String tenantId; | |||
| /*商户id**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="商户id",name="merchantId") | |||
| private Long merchantId; | |||
| /*券类型(1.满减券,2.代金券,3.团购券,4.礼品券,5.停车券)**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="券类型(1.满减券,2.代金券,3.团购券,4.礼品券,5.停车券)",name="type") | |||
| private Integer type; | |||
| /*封面图**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="封面图",name="coverImg") | |||
| private String coverImg; | |||
| /*券名称**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="券名称",name="title") | |||
| private String title; | |||
| /*副标题**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="副标题",name="subTitle") | |||
| private String subTitle; | |||
| /*售价(适用于类型2,3,4,5)**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="售价(适用于类型2,3,4,5)",name="salePrice") | |||
| private Integer salePrice; | |||
| /*使用条件金额(适用于类型1,2,3,4)**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="使用条件金额(适用于类型1,2,3,4)",name="usePrice") | |||
| private Integer usePrice; | |||
| /*限领张数**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="限领张数",name="useLimitQuantity") | |||
| private Integer useLimitQuantity; | |||
| /*投放频道位置(1.banner图,2.限时抢购)**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="投放频道位置(1.banner图,2.限时抢购)",name="targetAd") | |||
| private Integer targetAd; | |||
| /*1.主动领取2.定向投放**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="1.主动领取2.定向投放",name="sendType") | |||
| private Integer sendType; | |||
| /*发放开始时间**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="发放开始时间",name="sendStartDate") | |||
| private Date sendStartDate; | |||
| /*发放结束时间**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="发放结束时间",name="sendEndDate") | |||
| private Date sendEndDate; | |||
| /*有效时间类型1.时间范围(valid_start_date,valid_end_date). 2领取后几日有效(valid_days)**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="有效时间类型1.时间范围(valid_start_date,valid_end_date). 2领取后几日有效(valid_days)",name="validType") | |||
| private Integer validType; | |||
| /*有效日期-开始**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="有效日期-开始",name="validStartDate") | |||
| private Date validStartDate; | |||
| /*有效日期-结束**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="有效日期-结束",name="validEndDate") | |||
| private Date validEndDate; | |||
| /*自领取之日几日有效,(停车券当天有效)**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="自领取之日几日有效,(停车券当天有效)",name="validDays") | |||
| private Integer validDays; | |||
| /*须知**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="须知",name="detail") | |||
| private String detail; | |||
| /*面额**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="面额",name="price") | |||
| private Integer price; | |||
| /*剩余库存**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="剩余库存",name="remainInventory") | |||
| private Integer remainInventory; | |||
| /*总库存**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="总库存",name="inventory") | |||
| private Integer inventory; | |||
| /*购买须知**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="购买须知",name="remark") | |||
| private String remark; | |||
| /*状态(-1:全部,0:草稿/待生效,1:已生效,2:已失效,3:已作废)**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="状态(-1:全部,0:草稿/待生效,1:已生效,2:已失效,3:已作废)",name="status") | |||
| private Integer status; | |||
| /*创建时间**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="创建时间",name="createDate") | |||
| private Date createDate; | |||
| /*更新时间**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="更新时间",name="updateDate") | |||
| private Date updateDate; | |||
| /*业态**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="业态",name="business") | |||
| private String business; | |||
| /*发券商户信息*/ | |||
| /*商户图片**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="商户图片",name="imgUrl") | |||
| private String merchantImgUrl; | |||
| /*商户名**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="商户名",name="name") | |||
| private String merchantName; | |||
| /*联系方式**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="商户联系方式",name="linkPhone") | |||
| private String merchantLinkPhone; | |||
| /*商户状态**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="商户状态1可用0停用",name="status") | |||
| private Integer merchantStatus; | |||
| /*地址**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="地址",name="addr") | |||
| private String addr; | |||
| /*百度poi(省市区县street等)**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="百度poi(省市区县street等)",name="baiduPoi") | |||
| private String baiduPoi; | |||
| /*商铺编号**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="商铺编号",name="shopNumber") | |||
| private String shopNumber; | |||
| /*楼座号**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="楼座",name="buildingName") | |||
| private String buildingName; | |||
| /*楼层号**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="楼层",name="floorName") | |||
| private String floorName; | |||
| public String getTenantId() { | |||
| return tenantId; | |||
| } | |||
| public void setTenantId(String _tenantId) { | |||
| tenantId = _tenantId; | |||
| } | |||
| public Long getMerchantId() { | |||
| return merchantId; | |||
| } | |||
| public void setMerchantId(Long _merchantId) { | |||
| merchantId = _merchantId; | |||
| } | |||
| public Integer getType() { | |||
| return type; | |||
| } | |||
| public void setType(Integer _type) { | |||
| type = _type; | |||
| } | |||
| public String getCoverImg() { | |||
| return coverImg; | |||
| } | |||
| public void setCoverImg(String _coverImg) { | |||
| coverImg = _coverImg; | |||
| } | |||
| public String getTitle() { | |||
| return title; | |||
| } | |||
| public void setTitle(String _title) { | |||
| title = _title; | |||
| } | |||
| public String getSubTitle() { | |||
| return subTitle; | |||
| } | |||
| public void setSubTitle(String _subTitle) { | |||
| subTitle = _subTitle; | |||
| } | |||
| public Integer getSalePrice() { | |||
| return salePrice; | |||
| } | |||
| public void setSalePrice(Integer _salePrice) { | |||
| salePrice = _salePrice; | |||
| } | |||
| public Integer getUsePrice() { | |||
| return usePrice; | |||
| } | |||
| public void setUsePrice(Integer _usePrice) { | |||
| usePrice = _usePrice; | |||
| } | |||
| public Integer getUseLimitQuantity() { | |||
| return useLimitQuantity; | |||
| } | |||
| public void setUseLimitQuantity(Integer _useLimitQuantity) { | |||
| useLimitQuantity = _useLimitQuantity; | |||
| } | |||
| public Integer getTargetAd() { | |||
| return targetAd; | |||
| } | |||
| public void setTargetAd(Integer _targetAd) { | |||
| targetAd = _targetAd; | |||
| } | |||
| public Integer getSendType() { | |||
| return sendType; | |||
| } | |||
| public void setSendType(Integer _sendType) { | |||
| sendType = _sendType; | |||
| } | |||
| public Date getSendStartDate() { | |||
| return sendStartDate; | |||
| } | |||
| public void setSendStartDate(Date _sendStartDate) { | |||
| sendStartDate = _sendStartDate; | |||
| } | |||
| public Date getSendEndDate() { | |||
| return sendEndDate; | |||
| } | |||
| public void setSendEndDate(Date _sendEndDate) { | |||
| sendEndDate = _sendEndDate; | |||
| } | |||
| public Integer getValidType() { | |||
| return validType; | |||
| } | |||
| public void setValidType(Integer _validType) { | |||
| validType = _validType; | |||
| } | |||
| public Date getValidStartDate() { | |||
| return validStartDate; | |||
| } | |||
| public void setValidStartDate(Date _validStartDate) { | |||
| validStartDate = _validStartDate; | |||
| } | |||
| public Date getValidEndDate() { | |||
| return validEndDate; | |||
| } | |||
| public void setValidEndDate(Date _validEndDate) { | |||
| validEndDate = _validEndDate; | |||
| } | |||
| public Integer getValidDays() { | |||
| return validDays; | |||
| } | |||
| public void setValidDays(Integer _validDays) { | |||
| validDays = _validDays; | |||
| } | |||
| public String getDetail() { | |||
| return detail; | |||
| } | |||
| public void setDetail(String _detail) { | |||
| detail = _detail; | |||
| } | |||
| public Integer getPrice() { | |||
| return price; | |||
| } | |||
| public void setPrice(Integer _price) { | |||
| price = _price; | |||
| } | |||
| public Integer getRemainInventory() { | |||
| return remainInventory; | |||
| } | |||
| public void setRemainInventory(Integer _remainInventory) { | |||
| remainInventory = _remainInventory; | |||
| } | |||
| public Integer getInventory() { | |||
| return inventory; | |||
| } | |||
| public void setInventory(Integer _inventory) { | |||
| inventory = _inventory; | |||
| } | |||
| public String getRemark() { | |||
| return remark; | |||
| } | |||
| public void setRemark(String _remark) { | |||
| remark = _remark; | |||
| } | |||
| public Integer getStatus() { | |||
| return status; | |||
| } | |||
| public void setStatus(Integer _status) { | |||
| status = _status; | |||
| } | |||
| public Date getCreateDate() { | |||
| return createDate; | |||
| } | |||
| public void setCreateDate(Date _createDate) { | |||
| createDate = _createDate; | |||
| } | |||
| public Date getUpdateDate() { | |||
| return updateDate; | |||
| } | |||
| public void setUpdateDate(Date _updateDate) { | |||
| updateDate = _updateDate; | |||
| } | |||
| public String getBusiness() { | |||
| return business; | |||
| } | |||
| public void setBusiness(String _business) { | |||
| business = _business; | |||
| } | |||
| public String getSalePriceStr() { | |||
| if(salePrice!=null) { | |||
| DecimalFormat df=new DecimalFormat("0.00"); | |||
| salePriceStr = df.format((float)salePrice/100); | |||
| } | |||
| return salePriceStr; | |||
| } | |||
| public void setSalePriceStr(String salePriceStr) { | |||
| this.salePriceStr = salePriceStr; | |||
| } | |||
| public String getUsePriceStr() { | |||
| if(usePrice!=null) { | |||
| DecimalFormat df=new DecimalFormat("0.00"); | |||
| usePriceStr = df.format((float)usePrice/100); | |||
| } | |||
| return usePriceStr; | |||
| } | |||
| public void setUsePriceStr(String usePriceStr) { | |||
| this.usePriceStr = usePriceStr; | |||
| } | |||
| public String getPriceStr() { | |||
| if(price!=null) { | |||
| DecimalFormat df=new DecimalFormat("0.00"); | |||
| priceStr = df.format((float)price/100); | |||
| } | |||
| return priceStr; | |||
| } | |||
| public void setPriceStr(String priceStr) { | |||
| this.priceStr = priceStr; | |||
| } | |||
| public String getBuildingName() {return buildingName; } | |||
| public void setBuildingName(String _building) { | |||
| buildingName = _building; | |||
| } | |||
| public String getFloorName() { | |||
| return floorName; | |||
| } | |||
| public void setFloorName(String _floor) { | |||
| floorName = _floor; | |||
| } | |||
| public String getShopNumber() { | |||
| return shopNumber; | |||
| } | |||
| public void setShopNumber(String _shopNumber) { | |||
| shopNumber = _shopNumber; | |||
| } | |||
| public String getBaiduPoi() { | |||
| return baiduPoi; | |||
| } | |||
| public void setBaiduPoi(String _baiduPoi) { | |||
| baiduPoi = _baiduPoi; | |||
| } | |||
| public String getAddr() { | |||
| return addr; | |||
| } | |||
| public void setAddr(String _addr) { | |||
| addr = _addr; | |||
| } | |||
| public String getMerChantImgUrl() { | |||
| return merchantImgUrl; | |||
| } | |||
| public void setMerChantImgUrl(String _imgUrl) { | |||
| merchantImgUrl = _imgUrl; | |||
| } | |||
| public String getMerchantName() { | |||
| return merchantName; | |||
| } | |||
| public void setMerchantName(String _name) { | |||
| merchantName = _name; | |||
| } | |||
| public String getMerchantLinkPhone() { | |||
| return merchantLinkPhone; | |||
| } | |||
| public void setMerchantLinkPhone(String _linkPhone) { | |||
| merchantLinkPhone = _linkPhone; | |||
| } | |||
| public Integer getMerchantStatus() { | |||
| return merchantStatus; | |||
| } | |||
| public void setMerchantStatus(Integer status) { | |||
| this.merchantStatus = status; | |||
| } | |||
| public static enum Field | |||
| { | |||
| Id_ASC("`id` ASC"),Id_DESC("`id` DESC") | |||
| ,TenantId_ASC("`tenantId` ASC"),TenantId_DESC("`tenantId` DESC") | |||
| ,MerchantId_ASC("`merchantId` ASC"),MerchantId_DESC("`merchantId` DESC") | |||
| ,Type_ASC("`type` ASC"),Type_DESC("`type` DESC") | |||
| ,CoverImg_ASC("`coverImg` ASC"),CoverImg_DESC("`coverImg` DESC") | |||
| ,Title_ASC("`title` ASC"),Title_DESC("`title` DESC") | |||
| ,SubTitle_ASC("`subTitle` ASC"),SubTitle_DESC("`subTitle` DESC") | |||
| ,SalePrice_ASC("`salePrice` ASC"),SalePrice_DESC("`salePrice` DESC") | |||
| ,UsePrice_ASC("`usePrice` ASC"),UsePrice_DESC("`usePrice` DESC") | |||
| ,UseLimitQuantity_ASC("`useLimitQuantity` ASC"),UseLimitQuantity_DESC("`useLimitQuantity` DESC") | |||
| ,TargetAd_ASC("`targetAd` ASC"),TargetAd_DESC("`targetAd` DESC") | |||
| ,SendType_ASC("`sendType` ASC"),SendType_DESC("`sendType` DESC") | |||
| ,SendStartDate_ASC("`sendStartDate` ASC"),SendStartDate_DESC("`sendStartDate` DESC") | |||
| ,SendEndDate_ASC("`sendEndDate` ASC"),SendEndDate_DESC("`sendEndDate` DESC") | |||
| ,ValidType_ASC("`validType` ASC"),ValidType_DESC("`validType` DESC") | |||
| ,ValidStartDate_ASC("`validStartDate` ASC"),ValidStartDate_DESC("`validStartDate` DESC") | |||
| ,ValidEndDate_ASC("`validEndDate` ASC"),ValidEndDate_DESC("`validEndDate` DESC") | |||
| ,ValidDays_ASC("`validDays` ASC"),ValidDays_DESC("`validDays` DESC") | |||
| ,Detail_ASC("`detail` ASC"),Detail_DESC("`detail` DESC") | |||
| ,Price_ASC("`price` ASC"),Price_DESC("`price` DESC") | |||
| ,RemainInventory_ASC("`remainInventory` ASC"),RemainInventory_DESC("`remainInventory` DESC") | |||
| ,Inventory_ASC("`inventory` ASC"),Inventory_DESC("`inventory` DESC") | |||
| ,Remark_ASC("`remark` ASC"),Remark_DESC("`remark` DESC") | |||
| ,Status_ASC("`status` ASC"),Status_DESC("`status` DESC") | |||
| ,CreateDate_ASC("`createDate` ASC"),CreateDate_DESC("`createDate` DESC") | |||
| ,UpdateDate_ASC("`updateDate` ASC"),UpdateDate_DESC("`updateDate` DESC") | |||
| ,Business_ASC("`business` ASC"),Business_DESC("`business` DESC") | |||
| ; | |||
| private String value; | |||
| Field(String value){ | |||
| this.value = value; | |||
| } | |||
| public String getValue() { | |||
| return value; | |||
| } | |||
| public void setCol(String value) { | |||
| this.value = value; | |||
| } | |||
| @Override | |||
| public String toString() { | |||
| return this.getValue(); | |||
| } | |||
| } | |||
| public void setSortColumns(WxCoupon.Field... fields) | |||
| { | |||
| if (fields == null || fields.length == 0) { | |||
| return; | |||
| } | |||
| for (int k = 0; k < fields.length; k++) { | |||
| if (fields[k] == null) { | |||
| return; | |||
| } | |||
| } | |||
| StringBuilder sb = new StringBuilder(fields[0].toString()); | |||
| for (int k = 1; k < fields.length; k++) { | |||
| sb.append(","); | |||
| sb.append(fields[k].toString()); | |||
| } | |||
| } | |||
| public void setSortColumns(String sortColumns) | |||
| { | |||
| if (sortColumns == null || "".equals(sortColumns.trim())) { | |||
| return; | |||
| } | |||
| if (sortColumns.contains(",")) { | |||
| String[] cols = sortColumns.split(","); | |||
| List<WxCoupon.Field> fList = new java.util.ArrayList(); | |||
| for (int k = 0; k < cols.length; k++) { | |||
| fList.add(WxCoupon.Field.valueOf(cols[k])); | |||
| } | |||
| this.setSortColumns(fList.toArray(new WxCoupon.Field[fList.size()])); | |||
| } else { | |||
| this.setSortColumns(WxCoupon.Field.valueOf(sortColumns)); | |||
| } | |||
| } | |||
| } | |||
| @@ -27,6 +27,10 @@ public class WxCouponChannelVo extends WxCouponChannel implements Serializable { | |||
| /*使用条件金额(适用于类型1,2,3,4)**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="使用条件金额(适用于类型1,2,3,4)",name="usePrice") | |||
| private Integer usePrice; | |||
| /*面额**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="面额",name="price") | |||
| private Integer price; | |||
| @Transient | |||
| private String salePriceStr; | |||
| @@ -34,6 +38,9 @@ public class WxCouponChannelVo extends WxCouponChannel implements Serializable { | |||
| @Transient | |||
| private String usePriceStr; | |||
| @Transient | |||
| private String priceStr; | |||
| /*限领张数**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="限领张数",name="useLimitQuantity") | |||
| private Integer useLimitQuantity; | |||
| @@ -88,6 +95,14 @@ public class WxCouponChannelVo extends WxCouponChannel implements Serializable { | |||
| this.usePrice = usePrice; | |||
| } | |||
| public void setPrice(Integer price) { | |||
| this.price = price; | |||
| } | |||
| public Integer getPrice() { | |||
| return price; | |||
| } | |||
| public Integer getUseLimitQuantity() { | |||
| return useLimitQuantity; | |||
| } | |||
| @@ -144,10 +159,24 @@ public class WxCouponChannelVo extends WxCouponChannel implements Serializable { | |||
| this.usePriceStr = usePriceStr; | |||
| } | |||
| public String getPriceStr() { | |||
| if(price!=null) { | |||
| DecimalFormat df=new DecimalFormat("0.00"); | |||
| priceStr = df.format((float)price/100); | |||
| } | |||
| return priceStr; | |||
| } | |||
| public void setPriceStr(String priceStr) { | |||
| this.priceStr = priceStr; | |||
| } | |||
| public WxCouponChannelVo(){} | |||
| public WxCouponChannelVo setWxCoupon (WxCoupon wxCoupon){ | |||
| this.coverImg=wxCoupon.getCoverImg(); | |||
| this.remainInventory=wxCoupon.getRemainInventory(); | |||
| this.price=wxCoupon.getPrice(); | |||
| this.salePrice=wxCoupon.getSalePrice(); | |||
| this.sendStartDate=wxCoupon.getSendStartDate(); | |||
| this.sendEndDate=wxCoupon.getSendEndDate(); | |||
| @@ -0,0 +1,284 @@ | |||
| package com.simple.domain.vo; | |||
| import com.simple.domain.po.WxCouponOrder; | |||
| import javax.persistence.Id; | |||
| import javax.persistence.Transient; | |||
| import java.util.Date; | |||
| import java.util.List; | |||
| public class WxCouponOrderBVo extends WxCouponOrder{ | |||
| /** | |||
| * | |||
| */ | |||
| private static final long serialVersionUID = 6687954932922444531L; | |||
| @Id | |||
| protected Long id; | |||
| @Transient | |||
| protected List<Long> ids; | |||
| @Transient | |||
| protected String sortColumns; | |||
| public Long getId() { | |||
| return id; | |||
| } | |||
| public void setId(Long id) { | |||
| this.id = id; | |||
| } | |||
| public String getSortColumns() { | |||
| return sortColumns; | |||
| } | |||
| public List<Long> getIds() { | |||
| return ids; | |||
| } | |||
| public void setIds(List<Long> ids) { | |||
| this.ids = ids; | |||
| } | |||
| /* 基础购买到的券信息 */ | |||
| /***/ | |||
| @io.swagger.annotations.ApiModelProperty(value = "", name = "tenantId") | |||
| private String tenantId; | |||
| /*单张券ID**/ | |||
| @io.swagger.annotations.ApiModelProperty(value = "单张券ID", name = "couponId") | |||
| private Long couponId; | |||
| /*c端用户id**/ | |||
| @io.swagger.annotations.ApiModelProperty(value = "c端用户id", name = "cUserId") | |||
| private Long cUserId; | |||
| /*操作券B端小程序用户ID**/ | |||
| @io.swagger.annotations.ApiModelProperty(value = "操作券B端小程序用户ID", name = "bUserId") | |||
| private Long bUserId; | |||
| /*用户订单ID**/ | |||
| @io.swagger.annotations.ApiModelProperty(value = "用户订单ID", name = "orderId") | |||
| private Long orderId; | |||
| /*该订单对应券的实际过期时间**/ | |||
| @io.swagger.annotations.ApiModelProperty(value = "该订单对应券的实际过期时间 ", name = "expiredTime") | |||
| private Date expiredTime; | |||
| /*状态:0,待使用 1,已核销 2,已过期 3,已作废 **/ | |||
| @io.swagger.annotations.ApiModelProperty(value = "状态:0,待使用 1,已核销 2,已过期 3,已作废 ", name = "couponOrderStatus") | |||
| private Integer couponOrderStatus; | |||
| /***/ | |||
| @io.swagger.annotations.ApiModelProperty(value = "", name = "createDate") | |||
| private Date createDate; | |||
| /***/ | |||
| @io.swagger.annotations.ApiModelProperty(value = "", name = "updateDate") | |||
| private Date updateDate; | |||
| /*单券实际购买价格**/ | |||
| @io.swagger.annotations.ApiModelProperty(value = "单券实际购买价格", name = "couponPrice") | |||
| private Integer couponPrice; | |||
| /*券类型(1.满减券,2.代金券,3.团购券,4.礼品券,5.停车券)**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="券类型(1.满减券,2.代金券,3.团购券,4.礼品券,5.停车券)",name="type") | |||
| private Integer type; | |||
| /*券名称**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="券名称",name="title") | |||
| private String title; | |||
| /*售价(适用于类型2,3,4,5)**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="售价(适用于类型2,3,4,5)",name="salePrice") | |||
| private Integer salePrice; | |||
| /*使用条件金额(适用于类型1,2,3,4)**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="使用条件金额(适用于类型1,2,3,4)",name="usePrice") | |||
| private Integer usePrice; | |||
| /*面额**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="面额",name="price") | |||
| private Integer price; | |||
| /*b端用户姓名**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="b端用户姓名",name="bUserName") | |||
| private String bUserName; | |||
| /*c用户绑定的手机号**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="用户绑定的手机号",name="cUserPhone") | |||
| private String cUserPhone; | |||
| public String getTenantId() { | |||
| return tenantId; | |||
| } | |||
| public void setTenantId(String _tenantId) { | |||
| tenantId = _tenantId; | |||
| } | |||
| public Long getCouponId() { | |||
| return couponId; | |||
| } | |||
| public void setCouponId(Long _couponId) { | |||
| couponId = _couponId; | |||
| } | |||
| public Long getCUserId() { | |||
| return cUserId; | |||
| } | |||
| public void setCUserId(Long _cUserId) { | |||
| cUserId = _cUserId; | |||
| } | |||
| public Long getBUserId() { | |||
| return bUserId; | |||
| } | |||
| public void setBUserId(Long _bUserId) { | |||
| bUserId = _bUserId; | |||
| } | |||
| public Long getOrderId() { | |||
| return orderId; | |||
| } | |||
| public void setOrderId(Long _orderId) { | |||
| orderId = _orderId; | |||
| } | |||
| public Date getExpiredTime() { | |||
| return expiredTime; | |||
| } | |||
| public void setExpiredTime(Date _expiredTime) { | |||
| expiredTime = _expiredTime; | |||
| } | |||
| public Integer getCouponOrderStatus() { | |||
| return couponOrderStatus; | |||
| } | |||
| public void setCouponOrderStatus(Integer _couponOrderStatus) { | |||
| couponOrderStatus = _couponOrderStatus; | |||
| } | |||
| public Date getCreateDate() { | |||
| return createDate; | |||
| } | |||
| public void setCreateDate(Date _createDate) { | |||
| createDate = _createDate; | |||
| } | |||
| public Date getUpdateDate() { | |||
| return updateDate; | |||
| } | |||
| public void setUpdateDate(Date _updateDate) { | |||
| updateDate = _updateDate; | |||
| } | |||
| public Integer getCouponPrice() { | |||
| return couponPrice; | |||
| } | |||
| public void setCouponPrice(Integer _couponPrice) { | |||
| couponPrice = _couponPrice; | |||
| } | |||
| public Integer getType() { | |||
| return type; | |||
| } | |||
| public void setType(Integer _type) { | |||
| type = _type; | |||
| } | |||
| public String getTitle() { | |||
| return title; | |||
| } | |||
| public void setTitle(String _title) { | |||
| title = _title; | |||
| } | |||
| public Integer getSalePrice() { | |||
| return salePrice; | |||
| } | |||
| public void setSalePrice(Integer _salePrice) { | |||
| salePrice = _salePrice; | |||
| } | |||
| public Integer getUsePrice() { | |||
| return usePrice; | |||
| } | |||
| public void setUsePrice(Integer _usePrice) { | |||
| usePrice = _usePrice; | |||
| } | |||
| public Integer getPrice() { | |||
| return price; | |||
| } | |||
| public void setPrice(Integer _price) { | |||
| price = _price; | |||
| } | |||
| public String getCUserPhone() { | |||
| return cUserPhone; | |||
| } | |||
| public void setCUserPhone(String _phone) { | |||
| cUserPhone = _phone; | |||
| } | |||
| public String getBUserName() { | |||
| return bUserName; | |||
| } | |||
| public void setBUserName(String _name) { | |||
| this.bUserName = _name; | |||
| } | |||
| public static enum Field { | |||
| Id_ASC("`id` ASC"), Id_DESC("`id` DESC"), | |||
| TenantId_ASC("`tenantId` ASC"), | |||
| TenantId_DESC("`tenantId` DESC"), | |||
| CouponId_ASC("`couponId` ASC"), | |||
| CouponId_DESC("`couponId` DESC"), | |||
| CUserId_ASC("`cUserId` ASC"), | |||
| CUserId_DESC("`cUserId` DESC"), | |||
| BUserId_ASC("`bUserId` ASC"), | |||
| BUserId_DESC("`bUserId` DESC"), | |||
| OrderId_ASC("`orderId` ASC"), | |||
| OrderId_DESC("`orderId` DESC"), | |||
| ExpiredTime_ASC("`expiredTime` ASC"), | |||
| ExpiredTime_DESC("`expiredTime` DESC"), | |||
| CouponOrderStatus_ASC("`couponOrderStatus` ASC"), | |||
| CouponOrderStatus_DESC("`couponOrderStatus` DESC"), | |||
| CreateDate_ASC("`createDate` ASC"), | |||
| CreateDate_DESC("`createDate` DESC"), | |||
| UpdateDate_ASC("`updateDate` ASC"), | |||
| UpdateDate_DESC("`updateDate` DESC"), | |||
| CouponPrice_ASC("`couponPrice` ASC"), | |||
| CouponPrice_DESC("`couponPrice` DESC"); | |||
| private String value; | |||
| Field(String value) { | |||
| this.value = value; | |||
| } | |||
| public String getValue() { | |||
| return value; | |||
| } | |||
| public void setCol(String value) { | |||
| this.value = value; | |||
| } | |||
| @Override | |||
| public String toString() { | |||
| return this.getValue(); | |||
| } | |||
| } | |||
| public void setSortColumns(WxCouponOrder.Field... fields) { | |||
| if (fields == null || fields.length == 0) { | |||
| return; | |||
| } | |||
| for (int k = 0; k < fields.length; k++) { | |||
| if (fields[k] == null) { | |||
| return; | |||
| } | |||
| } | |||
| StringBuilder sb = new StringBuilder(fields[0].toString()); | |||
| for (int k = 1; k < fields.length; k++) { | |||
| sb.append(","); | |||
| sb.append(fields[k].toString()); | |||
| } | |||
| } | |||
| public void setSortColumns(String sortColumns) { | |||
| if (sortColumns == null || "".equals(sortColumns.trim())) { | |||
| return; | |||
| } | |||
| if (sortColumns.contains(",")) { | |||
| String[] cols = sortColumns.split(","); | |||
| java.util.List<WxCouponOrder.Field> fList = new java.util.ArrayList(); | |||
| for (int k = 0; k < cols.length; k++) { | |||
| fList.add(WxCouponOrder.Field.valueOf(cols[k])); | |||
| } | |||
| this.setSortColumns(fList.toArray(new WxCouponOrder.Field[fList.size()])); | |||
| } else { | |||
| this.setSortColumns(WxCouponOrder.Field.valueOf(sortColumns)); | |||
| } | |||
| } | |||
| } | |||
| @@ -0,0 +1,397 @@ | |||
| package com.simple.domain.vo; | |||
| import com.simple.domain.po.WxCouponOrder; | |||
| import javax.persistence.Id; | |||
| import javax.persistence.Transient; | |||
| import java.util.Date; | |||
| import java.util.List; | |||
| public class WxCouponOrderCVo extends WxCouponOrder{ | |||
| /** | |||
| * | |||
| */ | |||
| private static final long serialVersionUID = 6687954932922444531L; | |||
| @Id | |||
| protected Long id; | |||
| @Transient | |||
| protected List<Long> ids; | |||
| @Transient | |||
| protected String sortColumns; | |||
| public Long getId() { | |||
| return id; | |||
| } | |||
| public void setId(Long id) { | |||
| this.id = id; | |||
| } | |||
| public String getSortColumns() { | |||
| return sortColumns; | |||
| } | |||
| public List<Long> getIds() { | |||
| return ids; | |||
| } | |||
| public void setIds(List<Long> ids) { | |||
| this.ids = ids; | |||
| } | |||
| /* 基础购买到的券信息 */ | |||
| /***/ | |||
| @io.swagger.annotations.ApiModelProperty(value = "", name = "tenantId") | |||
| private String tenantId; | |||
| /*单张券ID**/ | |||
| @io.swagger.annotations.ApiModelProperty(value = "单张券ID", name = "couponId") | |||
| private Long couponId; | |||
| /*c端用户id**/ | |||
| @io.swagger.annotations.ApiModelProperty(value = "c端用户id", name = "cUserId") | |||
| private Long cUserId; | |||
| /*操作券B端小程序用户ID**/ | |||
| @io.swagger.annotations.ApiModelProperty(value = "操作券B端小程序用户ID", name = "bUserId") | |||
| private Long bUserId; | |||
| /*用户订单ID**/ | |||
| @io.swagger.annotations.ApiModelProperty(value = "用户订单ID", name = "orderId") | |||
| private Long orderId; | |||
| /*该订单对应券的实际过期时间**/ | |||
| @io.swagger.annotations.ApiModelProperty(value = "该订单对应券的实际过期时间 ", name = "expiredTime") | |||
| private Date expiredTime; | |||
| /*状态:0,待使用 1,已核销 2,已过期 3,已作废 **/ | |||
| @io.swagger.annotations.ApiModelProperty(value = "状态:0,待使用 1,已核销 2,已过期 3,已作废 ", name = "couponOrderStatus") | |||
| private Integer couponOrderStatus; | |||
| /***/ | |||
| @io.swagger.annotations.ApiModelProperty(value = "", name = "createDate") | |||
| private Date createDate; | |||
| /***/ | |||
| @io.swagger.annotations.ApiModelProperty(value = "", name = "updateDate") | |||
| private Date updateDate; | |||
| /*单券实际购买价格**/ | |||
| @io.swagger.annotations.ApiModelProperty(value = "单券实际购买价格", name = "couponPrice") | |||
| private Integer couponPrice; | |||
| /* 券类型信息 */ | |||
| /*商户id**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="商户id",name="merchantId") | |||
| private Long merchantId; | |||
| /*券类型(1.满减券,2.代金券,3.团购券,4.礼品券,5.停车券)**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="券类型(1.满减券,2.代金券,3.团购券,4.礼品券,5.停车券)",name="type") | |||
| private Integer type; | |||
| /*封面图**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="封面图",name="coverImg") | |||
| private String coverImg; | |||
| /*券名称**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="券名称",name="title") | |||
| private String title; | |||
| /*副标题**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="副标题",name="subTitle") | |||
| private String subTitle; | |||
| /*售价(适用于类型2,3,4,5)**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="售价(适用于类型2,3,4,5)",name="salePrice") | |||
| private Integer salePrice; | |||
| /*使用条件金额(适用于类型1,2,3,4)**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="使用条件金额(适用于类型1,2,3,4)",name="usePrice") | |||
| private Integer usePrice; | |||
| /*面额**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="面额",name="price") | |||
| private Integer price; | |||
| /*须知**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="须知",name="detail") | |||
| private String detail; | |||
| /*购买须知**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="购买须知",name="remark") | |||
| private String remark; | |||
| /*发券商户信息*/ | |||
| /*商户图片**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="商户图片",name="imgUrl") | |||
| private String merchantImgUrl; | |||
| /*商户名**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="商户名",name="name") | |||
| private String merchantName; | |||
| /*联系方式**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="商户联系方式",name="linkPhone") | |||
| private String merchantLinkPhone; | |||
| /*商户状态**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="商户状态1可用0停用",name="status") | |||
| private Integer merchantStatus; | |||
| /*地址**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="地址",name="addr") | |||
| private String addr; | |||
| /*百度poi(省市区县street等)**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="百度poi(省市区县street等)",name="baiduPoi") | |||
| private String baiduPoi; | |||
| /*商铺编号**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="商铺编号",name="shopNumber") | |||
| private String shopNumber; | |||
| /*楼座号**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="楼座",name="buildingName") | |||
| private String buildingName; | |||
| /*楼层号**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="楼层",name="floorName") | |||
| private String floorName; | |||
| public String getTenantId() { | |||
| return tenantId; | |||
| } | |||
| public void setTenantId(String _tenantId) { | |||
| tenantId = _tenantId; | |||
| } | |||
| public Long getCouponId() { | |||
| return couponId; | |||
| } | |||
| public void setCouponId(Long _couponId) { | |||
| couponId = _couponId; | |||
| } | |||
| public Long getCUserId() { | |||
| return cUserId; | |||
| } | |||
| public void setCUserId(Long _cUserId) { | |||
| cUserId = _cUserId; | |||
| } | |||
| public Long getBUserId() { | |||
| return bUserId; | |||
| } | |||
| public void setBUserId(Long _bUserId) { | |||
| bUserId = _bUserId; | |||
| } | |||
| public Long getOrderId() { | |||
| return orderId; | |||
| } | |||
| public void setOrderId(Long _orderId) { | |||
| orderId = _orderId; | |||
| } | |||
| public Date getExpiredTime() { | |||
| return expiredTime; | |||
| } | |||
| public void setExpiredTime(Date _expiredTime) { | |||
| expiredTime = _expiredTime; | |||
| } | |||
| public Integer getCouponOrderStatus() { | |||
| return couponOrderStatus; | |||
| } | |||
| public void setCouponOrderStatus(Integer _couponOrderStatus) { | |||
| couponOrderStatus = _couponOrderStatus; | |||
| } | |||
| public Date getCreateDate() { | |||
| return createDate; | |||
| } | |||
| public void setCreateDate(Date _createDate) { | |||
| createDate = _createDate; | |||
| } | |||
| public Date getUpdateDate() { | |||
| return updateDate; | |||
| } | |||
| public void setUpdateDate(Date _updateDate) { | |||
| updateDate = _updateDate; | |||
| } | |||
| public Integer getCouponPrice() { | |||
| return couponPrice; | |||
| } | |||
| public void setCouponPrice(Integer _couponPrice) { | |||
| couponPrice = _couponPrice; | |||
| } | |||
| public Long getMerchantId() { | |||
| return merchantId; | |||
| } | |||
| public void setMerchantId(Long _merchantId) { | |||
| merchantId = _merchantId; | |||
| } | |||
| public Integer getType() { | |||
| return type; | |||
| } | |||
| public void setType(Integer _type) { | |||
| type = _type; | |||
| } | |||
| public String getCoverImg() { | |||
| return coverImg; | |||
| } | |||
| public void setCoverImg(String _coverImg) { | |||
| coverImg = _coverImg; | |||
| } | |||
| public String getTitle() { | |||
| return title; | |||
| } | |||
| public void setTitle(String _title) { | |||
| title = _title; | |||
| } | |||
| public String getSubTitle() { | |||
| return subTitle; | |||
| } | |||
| public void setSubTitle(String _subTitle) { | |||
| subTitle = _subTitle; | |||
| } | |||
| public Integer getSalePrice() { | |||
| return salePrice; | |||
| } | |||
| public void setSalePrice(Integer _salePrice) { | |||
| salePrice = _salePrice; | |||
| } | |||
| public Integer getUsePrice() { | |||
| return usePrice; | |||
| } | |||
| public void setUsePrice(Integer _usePrice) { | |||
| usePrice = _usePrice; | |||
| } | |||
| public String getDetail() { | |||
| return detail; | |||
| } | |||
| public void setDetail(String _detail) { | |||
| detail = _detail; | |||
| } | |||
| public Integer getPrice() { | |||
| return price; | |||
| } | |||
| public void setPrice(Integer _price) { | |||
| price = _price; | |||
| } | |||
| public String getRemark() { | |||
| return remark; | |||
| } | |||
| public void setRemark(String _remark) { | |||
| remark = _remark; | |||
| } | |||
| public String getBuildingName() {return buildingName; } | |||
| public void setBuildingName(String _building) { | |||
| buildingName = _building; | |||
| } | |||
| public String getFloorName() { | |||
| return floorName; | |||
| } | |||
| public void setFloorName(String _floor) { | |||
| floorName = _floor; | |||
| } | |||
| public String getShopNumber() { | |||
| return shopNumber; | |||
| } | |||
| public void setShopNumber(String _shopNumber) { | |||
| shopNumber = _shopNumber; | |||
| } | |||
| public String getBaiduPoi() { | |||
| return baiduPoi; | |||
| } | |||
| public void setBaiduPoi(String _baiduPoi) { | |||
| baiduPoi = _baiduPoi; | |||
| } | |||
| public String getAddr() { | |||
| return addr; | |||
| } | |||
| public void setAddr(String _addr) { | |||
| addr = _addr; | |||
| } | |||
| public String getMerChantImgUrl() { | |||
| return merchantImgUrl; | |||
| } | |||
| public void setMerChantImgUrl(String _imgUrl) { | |||
| merchantImgUrl = _imgUrl; | |||
| } | |||
| public String getMerchantName() { | |||
| return merchantName; | |||
| } | |||
| public void setMerchantName(String _name) { | |||
| merchantName = _name; | |||
| } | |||
| public String getMerchantLinkPhone() { | |||
| return merchantLinkPhone; | |||
| } | |||
| public void setMerchantLinkPhone(String _linkPhone) { | |||
| merchantLinkPhone = _linkPhone; | |||
| } | |||
| public Integer getMerchantStatus() { | |||
| return merchantStatus; | |||
| } | |||
| public void setMerchantStatus(Integer status) { | |||
| this.merchantStatus = status; | |||
| } | |||
| public static enum Field { | |||
| Id_ASC("`id` ASC"), Id_DESC("`id` DESC"), | |||
| TenantId_ASC("`tenantId` ASC"), | |||
| TenantId_DESC("`tenantId` DESC"), | |||
| CouponId_ASC("`couponId` ASC"), | |||
| CouponId_DESC("`couponId` DESC"), | |||
| CUserId_ASC("`cUserId` ASC"), | |||
| CUserId_DESC("`cUserId` DESC"), | |||
| BUserId_ASC("`bUserId` ASC"), | |||
| BUserId_DESC("`bUserId` DESC"), | |||
| OrderId_ASC("`orderId` ASC"), | |||
| OrderId_DESC("`orderId` DESC"), | |||
| ExpiredTime_ASC("`expiredTime` ASC"), | |||
| ExpiredTime_DESC("`expiredTime` DESC"), | |||
| CouponOrderStatus_ASC("`couponOrderStatus` ASC"), | |||
| CouponOrderStatus_DESC("`couponOrderStatus` DESC"), | |||
| CreateDate_ASC("`createDate` ASC"), | |||
| CreateDate_DESC("`createDate` DESC"), | |||
| UpdateDate_ASC("`updateDate` ASC"), | |||
| UpdateDate_DESC("`updateDate` DESC"), | |||
| CouponPrice_ASC("`couponPrice` ASC"), | |||
| CouponPrice_DESC("`couponPrice` DESC"); | |||
| private String value; | |||
| Field(String value) { | |||
| this.value = value; | |||
| } | |||
| public String getValue() { | |||
| return value; | |||
| } | |||
| public void setCol(String value) { | |||
| this.value = value; | |||
| } | |||
| @Override | |||
| public String toString() { | |||
| return this.getValue(); | |||
| } | |||
| } | |||
| public void setSortColumns(WxCouponOrder.Field... fields) { | |||
| if (fields == null || fields.length == 0) { | |||
| return; | |||
| } | |||
| for (int k = 0; k < fields.length; k++) { | |||
| if (fields[k] == null) { | |||
| return; | |||
| } | |||
| } | |||
| StringBuilder sb = new StringBuilder(fields[0].toString()); | |||
| for (int k = 1; k < fields.length; k++) { | |||
| sb.append(","); | |||
| sb.append(fields[k].toString()); | |||
| } | |||
| } | |||
| public void setSortColumns(String sortColumns) { | |||
| if (sortColumns == null || "".equals(sortColumns.trim())) { | |||
| return; | |||
| } | |||
| if (sortColumns.contains(",")) { | |||
| String[] cols = sortColumns.split(","); | |||
| java.util.List<WxCouponOrder.Field> fList = new java.util.ArrayList(); | |||
| for (int k = 0; k < cols.length; k++) { | |||
| fList.add(WxCouponOrder.Field.valueOf(cols[k])); | |||
| } | |||
| this.setSortColumns(fList.toArray(new WxCouponOrder.Field[fList.size()])); | |||
| } else { | |||
| this.setSortColumns(WxCouponOrder.Field.valueOf(sortColumns)); | |||
| } | |||
| } | |||
| } | |||
| @@ -1,14 +0,0 @@ | |||
| package com.simple.domain.vo; | |||
| import com.simple.domain.po.WxCouponOrder; | |||
| public class WxUserCouponVo extends WxCouponOrder{ | |||
| /** | |||
| * | |||
| */ | |||
| private static final long serialVersionUID = 6687954932922444531L; | |||
| } | |||
| @@ -12,7 +12,7 @@ public interface MallRolePermissionMapper extends CommonMapper<MallRolePermissio | |||
| void deleteByRoleId(Map<String, Object> map); | |||
| void deleteByRoleId(Long roleId); | |||
| @@ -10,7 +10,7 @@ public interface MallUserRoleMapper extends CommonMapper<MallUserRole, String> { | |||
| List<MallUserRole> findList(MallUserRole mallUserRole); | |||
| void deleteByUserId(Long userId); | |||
| @@ -0,0 +1,17 @@ | |||
| package com.simple.mapper; | |||
| import com.simple.common.CommonMapper; | |||
| import com.simple.domain.po.PushLimit; | |||
| import java.util.List; | |||
| public interface PushLimitMapper extends CommonMapper<PushLimit, Long> { | |||
| List<PushLimit> findList(PushLimit pushLimit); | |||
| } | |||
| @@ -0,0 +1,17 @@ | |||
| package com.simple.mapper; | |||
| import java.util.*; | |||
| import com.simple.common.CommonMapper; | |||
| import org.apache.ibatis.annotations.Param; | |||
| import com.simple.domain.po.WxAdminLog; | |||
| public interface WxAdminLogMapper extends CommonMapper<WxAdminLog, Long> { | |||
| List<WxAdminLog> findList(WxAdminLog wxAdminLog); | |||
| } | |||
| @@ -1,17 +0,0 @@ | |||
| package com.simple.mapper; | |||
| import java.util.*; | |||
| import com.simple.common.CommonMapper; | |||
| import org.apache.ibatis.annotations.Param; | |||
| import com.simple.domain.po.WxBanners; | |||
| public interface WxBannersMapper extends CommonMapper<WxBanners, String> { | |||
| List<WxBanners> findList(WxBanners wxBanners); | |||
| } | |||
| @@ -14,6 +14,8 @@ public interface WxCUserBasicInfoMapper extends CommonMapper<WxCUserBasicInfo, S | |||
| List<WxCUserBasicInfo> list(WxCuerBasicInfoDto record); | |||
| void updateScore(WxCUserBasicInfo record); | |||
| } | |||
| @@ -4,6 +4,7 @@ import java.util.List; | |||
| import com.simple.common.CommonMapper; | |||
| import com.simple.domain.po.WxCUserTags; | |||
| import org.apache.ibatis.annotations.Param; | |||
| public interface WxCUserTagsMapper extends CommonMapper<WxCUserTags, String> { | |||
| @@ -12,5 +13,9 @@ public interface WxCUserTagsMapper extends CommonMapper<WxCUserTags, String> { | |||
| long findCountByTag(List<Long> tagIds); | |||
| List<Long> findUserByTag(List<Long> tagIds); | |||
| long findCountByTags(@Param("tagIds")String tagIds); | |||
| List<Long> findUserByTags(@Param("tagIds")String tagIds); | |||
| } | |||
| @@ -2,7 +2,7 @@ package com.simple.mapper; | |||
| import java.util.*; | |||
| import com.simple.common.CommonMapper; | |||
| import com.simple.domain.vo.CouponListReq; | |||
| import com.simple.domain.vo.WxCouponCVo; | |||
| import org.apache.ibatis.annotations.Param; | |||
| import com.simple.domain.po.WxCoupon; | |||
| @@ -12,10 +12,11 @@ public interface WxCouponMapper extends CommonMapper<WxCoupon, Long> { | |||
| List<WxCoupon> findEnableList(WxCoupon wxCoupon); | |||
| List<WxCoupon> findCanSendList(WxCoupon record); | |||
| List<WxCoupon> findCanSendList(WxCoupon wxCoupon); | |||
| List<WxCouponCVo> findListForCUser(WxCoupon wxCoupon); | |||
| WxCouponCVo selectDetailForCUser(WxCoupon wxCoupon); | |||
| } | |||
| @@ -2,6 +2,8 @@ package com.simple.mapper; | |||
| import java.util.*; | |||
| import com.simple.common.CommonMapper; | |||
| import com.simple.domain.vo.WxCouponOrderBVo; | |||
| import com.simple.domain.vo.WxCouponOrderCVo; | |||
| import org.apache.ibatis.annotations.Param; | |||
| import com.simple.domain.po.WxCouponOrder; | |||
| @@ -9,7 +11,12 @@ public interface WxCouponOrderMapper extends CommonMapper<WxCouponOrder, Long> { | |||
| List<WxCouponOrder> findList(WxCouponOrder wxCouponOrder); | |||
| List<WxCouponOrder> findListOfOrderedByDate(Map dateMap); | |||
| List<WxCouponOrder> findListOfUnverifiedByDate(Map dateMap); | |||
| List<WxCouponOrder> findListOfVerifiedByDate(Map dateMap); | |||
| List<WxCouponOrderBVo> findListOfUnverifiedByDateForBUser(Map dateMap); | |||
| List<WxCouponOrderBVo> findListOfVerifiedByDateForBUser(Map dateMap); | |||
| List<WxCouponOrderCVo> findListOfCUser(Map paramMap); | |||
| WxCouponOrderCVo selectDetailOfCUser(Map paramMap); | |||
| } | |||
| @@ -1,17 +0,0 @@ | |||
| package com.simple.mapper; | |||
| import java.util.*; | |||
| import com.simple.common.CommonMapper; | |||
| import org.apache.ibatis.annotations.Param; | |||
| import com.simple.domain.po.WxCouponVerify; | |||
| public interface WxCouponVerifyMapper extends CommonMapper<WxCouponVerify, String> { | |||
| List<WxCouponVerify> findList(WxCouponVerify wxCouponVerify); | |||
| } | |||
| @@ -1,17 +1,18 @@ | |||
| package com.simple.mapper; | |||
| import java.util.*; | |||
| import com.simple.common.CommonMapper; | |||
| import org.apache.ibatis.annotations.Param; | |||
| import com.simple.domain.po.WxDateAmountRecord; | |||
| import java.util.List; | |||
| import java.util.Map; | |||
| public interface WxDateAmountRecordMapper extends CommonMapper<WxDateAmountRecord, String> { | |||
| List<WxDateAmountRecord> findList(WxDateAmountRecord wxDateAmountRecord); | |||
| int updateAmount(WxDateAmountRecord wxDateAmountRecord); | |||
| List<Map<String,Object>> queryprice(String tenantId); | |||
| } | |||
| @@ -0,0 +1,19 @@ | |||
| package com.simple.mapper; | |||
| import java.util.*; | |||
| import com.simple.common.CommonMapper; | |||
| import org.apache.ibatis.annotations.Param; | |||
| import com.simple.domain.po.WxLevelConfig; | |||
| public interface WxLevelConfigMapper extends CommonMapper<WxLevelConfig, Long> { | |||
| List<WxLevelConfig> findList(WxLevelConfig wxLevelConfig); | |||
| void deleteAll(); | |||
| String getLevel(@Param("tenantId")String tenantId,@Param("poins")Integer poins); | |||
| } | |||
| @@ -8,9 +8,9 @@ import com.simple.domain.po.WxMerchantTradeDaily; | |||
| public interface WxMerchantTradeDailyMapper extends CommonMapper<WxMerchantTradeDaily, String> { | |||
| List<WxMerchantTradeDaily> findList(WxMerchantTradeDaily wxMerchantTradeDaily); | |||
| List<WxMerchantTradeDaily> findListOfWeek(WxMerchantTradeDaily wxMerchantTradeDaily); | |||
| @@ -1,17 +1,16 @@ | |||
| package com.simple.mapper; | |||
| import java.util.*; | |||
| import com.simple.common.CommonMapper; | |||
| import org.apache.ibatis.annotations.Param; | |||
| import com.simple.domain.po.WxShop; | |||
| import java.util.List; | |||
| import java.util.Map; | |||
| public interface WxShopMapper extends CommonMapper<WxShop, String> { | |||
| List<WxShop> findList(WxShop wxShop); | |||
| List<Map<String,Object>> findListMap(WxShop record); | |||
| } | |||
| @@ -1,17 +0,0 @@ | |||
| package com.simple.mapper; | |||
| import java.util.*; | |||
| import com.simple.common.CommonMapper; | |||
| import org.apache.ibatis.annotations.Param; | |||
| import com.simple.domain.po.WxWebLog; | |||
| public interface WxWebLogMapper extends CommonMapper<WxWebLog, String> { | |||
| List<WxWebLog> findList(WxWebLog wxWebLog); | |||
| } | |||
| @@ -80,7 +80,7 @@ public class DaliyAmountSchedule { | |||
| dateMap.put("endDate", new Date()); | |||
| dateMap.put("merchantID",merchant.getId()); | |||
| List<WxCouponOrder> list = wxCouponOrderMapper.findListOfOrderedByDate(dateMap); | |||
| List<WxCouponOrder> list = wxCouponOrderMapper.findListOfUnverifiedByDate(dateMap); | |||
| logger.info("find " + list.size() + " coupon order from " + startDate + " to " + new Date()); | |||
| int total_price = 0; | |||
| for(WxCouponOrder couponOrder : list) { | |||
| @@ -0,0 +1,10 @@ | |||
| package com.simple.service; | |||
| import java.util.Map; | |||
| public interface DataTowerService { | |||
| Map<String,Object> queryRunning(String tenantId); | |||
| } | |||
| @@ -44,10 +44,10 @@ public interface MallRolePermissionService { | |||
| * @param roleId | |||
| * @param perId | |||
| */ | |||
| void savePermissions(Long roleId, Long[] perId); | |||
| void savePermissions(String tenantId,Long roleId, Long[] perId); | |||
| void deleteByRoleId(Long roleId); | |||
| } | |||
| @@ -47,7 +47,7 @@ public interface MallUserRoleService { | |||
| void deleteByUserId(Long uid); | |||
| @@ -1,10 +1,9 @@ | |||
| package com.simple.service; | |||
| import java.util.*; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.simple.domain.po.WxBanners; | |||
| import com.simple.domain.po.PushLimit; | |||
| public interface WxBannersService { | |||
| public interface PushLimitService { | |||
| /** | |||
| * 根据实体查询分页列表 | |||
| @@ -14,7 +13,7 @@ public interface WxBannersService { | |||
| * @param limit | |||
| * @return | |||
| */ | |||
| PageInfo<WxBanners> listAsPage(WxBanners record, Integer pageIndex, Integer pageSize); | |||
| PageInfo<PushLimit> listAsPage(PushLimit record, Integer pageIndex, Integer pageSize); | |||
| /** | |||
| * 根据Id获得实体 | |||
| @@ -22,14 +21,14 @@ public interface WxBannersService { | |||
| * @param id | |||
| * @return | |||
| */ | |||
| WxBanners getById(Long id); | |||
| PushLimit getById(Long id); | |||
| /** | |||
| * 保存或更新实体 | |||
| * | |||
| * @param record | |||
| */ | |||
| void saveOrUpdate(WxBanners record); | |||
| void saveOrUpdate(PushLimit record); | |||
| /** | |||
| * 根据Id删除实体 | |||
| @@ -2,19 +2,19 @@ package com.simple.service; | |||
| import java.util.*; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.simple.domain.po.WxCouponVerify; | |||
| import com.simple.domain.po.WxAdminLog; | |||
| public interface WxCouponVerifyService { | |||
| public interface WxAdminLogService { | |||
| /** | |||
| * 根据实体查询分页列表 | |||
| * | |||
| * @param record | |||
| * @param offset | |||
| * @param limit | |||
| * @param pageIndex | |||
| * @param pageSize | |||
| * @return | |||
| */ | |||
| PageInfo<WxCouponVerify> listAsPage(WxCouponVerify record, Integer pageIndex, Integer pageSize); | |||
| PageInfo<WxAdminLog> listAsPage(WxAdminLog record, Integer pageIndex, Integer pageSize); | |||
| /** | |||
| * 根据Id获得实体 | |||
| @@ -22,14 +22,14 @@ public interface WxCouponVerifyService { | |||
| * @param id | |||
| * @return | |||
| */ | |||
| WxCouponVerify getById(Long id); | |||
| WxAdminLog getById(Long id); | |||
| /** | |||
| * 保存或更新实体 | |||
| * | |||
| * @param record | |||
| */ | |||
| void saveOrUpdate(WxCouponVerify record); | |||
| void saveOrUpdate(WxAdminLog record); | |||
| /** | |||
| * 根据Id删除实体 | |||
| @@ -37,6 +37,10 @@ public interface WxCouponVerifyService { | |||
| * @param id | |||
| */ | |||
| void deleteById(Long id); | |||
| void saveLogCount(WxAdminLog record); | |||
| @@ -41,6 +41,16 @@ public interface WxCUserBasicInfoService { | |||
| PageInfo<WxCUserBasicInfo> list(WxCuerBasicInfoDto record, Integer pageIndex, Integer pageSize); | |||
| /** | |||
| * 修改会员积分 | |||
| * @param record | |||
| */ | |||
| void updateScore(WxCUserBasicInfo record); | |||
| @@ -1,12 +1,13 @@ | |||
| package com.simple.service; | |||
| import java.util.*; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.simple.domain.po.WxCUserCar; | |||
| import java.util.List; | |||
| public interface WxCUserCarService { | |||
| /** | |||
| /** | |||
| * 根据实体查询分页列表 | |||
| * | |||
| * @param record | |||
| @@ -14,7 +15,7 @@ public interface WxCUserCarService { | |||
| * @param pageSize | |||
| * @return | |||
| */ | |||
| PageInfo<WxCUserCar> listAsPage(WxCUserCar record, Integer pageIndex, Integer pageSize); | |||
| PageInfo<WxCUserCar> listAsPage(WxCUserCar record, Integer pageIndex, Integer pageSize); | |||
| /** | |||
| * 根据实体查询列表 | |||
| @@ -24,22 +25,44 @@ public interface WxCUserCarService { | |||
| */ | |||
| List<WxCUserCar> getList(WxCUserCar record); | |||
| /** | |||
| * 根据实体查询count | |||
| * | |||
| * @param record | |||
| * @return | |||
| */ | |||
| Integer countUserCar(WxCUserCar record); | |||
| /** | |||
| * 根据实体查询 | |||
| * | |||
| * @param record | |||
| * @return | |||
| */ | |||
| WxCUserCar getOne(WxCUserCar record); | |||
| /** | |||
| /** | |||
| * 根据Id获得实体 | |||
| * | |||
| * @param id | |||
| * @return | |||
| */ | |||
| WxCUserCar getById(Long id); | |||
| /** | |||
| /** | |||
| * 获取新的ID | |||
| */ | |||
| Long getNewCarID(); | |||
| /** | |||
| * 保存实体 | |||
| * | |||
| * @param record | |||
| */ | |||
| void save(WxCUserCar record); | |||
| /** | |||
| * 保存或更新实体 | |||
| * | |||
| * @param record | |||
| @@ -55,9 +78,10 @@ public interface WxCUserCarService { | |||
| /** | |||
| * 根据WxCUserCar删除实体 | |||
| * | |||
| * @param record | |||
| */ | |||
| void deleteByObj(WxCUserCar record); | |||
| } | |||
| @@ -1,6 +1,8 @@ | |||
| package com.simple.service; | |||
| import java.util.*; | |||
| import com.github.pagehelper.PageHelper; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.simple.common.ResultData; | |||
| import com.simple.domain.po.MallUserInfo; | |||
| @@ -62,10 +64,35 @@ public interface WxCouponOrderService { | |||
| * @param bUserId 退券(款)人(登录用户) | |||
| */ | |||
| ResultData refund(Long couponOrderId, Long bUserId); | |||
| /** | |||
| * 根据日期 b用户查券list | |||
| * | |||
| * @param bUserId B端用户) | |||
| */ | |||
| ResultData listOnDateAsPage(Long bUserId, String date, Integer pageIndex, Integer pageSize, boolean isVerified); | |||
| /** | |||
| * C用户查券list | |||
| * | |||
| * @param bUserId C端用户 | |||
| */ | |||
| ResultData listCUserVoAsPage(Long cUserId, Integer pageIndex, Integer pageSize, Integer status); | |||
| /** | |||
| * C用户查券详情 | |||
| * | |||
| * @param bUserId C端用户 | |||
| */ | |||
| ResultData detailCUserVo(Long cUserId, String couponOrderId); | |||
| /** | |||
| * B用户查券详情 | |||
| * | |||
| * @param bUserId B端用户 | |||
| */ | |||
| ResultData detailBUserVo(Long bUserId, String couponOrderId); | |||
| } | |||
| @@ -3,7 +3,7 @@ package com.simple.service; | |||
| import java.util.*; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.simple.domain.po.WxCoupon; | |||
| import com.simple.domain.vo.CouponListReq; | |||
| import com.simple.domain.vo.WxCouponCVo; | |||
| public interface WxCouponService { | |||
| @@ -59,11 +59,9 @@ public interface WxCouponService { | |||
| * | |||
| */ | |||
| PageInfo<WxCoupon> findCanSendList(WxCoupon record, Integer pageIndex, Integer pageSize); | |||
| PageInfo<WxCouponCVo> findListForCUser(WxCoupon record, Integer pageIndex, Integer pageSize); | |||
| WxCouponCVo selectDetailForCUser(WxCoupon record); | |||
| } | |||
| @@ -1,10 +1,9 @@ | |||
| package com.simple.service; | |||
| import java.util.*; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.simple.domain.po.WxWebLog; | |||
| import com.simple.domain.po.WxLevelConfig; | |||
| public interface WxWebLogService { | |||
| public interface WxLevelConfigService { | |||
| /** | |||
| * 根据实体查询分页列表 | |||
| @@ -14,7 +13,7 @@ public interface WxWebLogService { | |||
| * @param limit | |||
| * @return | |||
| */ | |||
| PageInfo<WxWebLog> listAsPage(WxWebLog record, Integer pageIndex, Integer pageSize); | |||
| PageInfo<WxLevelConfig> listAsPage(WxLevelConfig record, Integer pageIndex, Integer pageSize); | |||
| /** | |||
| * 根据Id获得实体 | |||
| @@ -22,14 +21,14 @@ public interface WxWebLogService { | |||
| * @param id | |||
| * @return | |||
| */ | |||
| WxWebLog getById(Long id); | |||
| WxLevelConfig getById(Long id); | |||
| /** | |||
| * 保存或更新实体 | |||
| * | |||
| * @param record | |||
| */ | |||
| void saveOrUpdate(WxWebLog record); | |||
| void saveOrUpdate(WxLevelConfig record); | |||
| /** | |||
| * 根据Id删除实体 | |||
| @@ -39,7 +38,14 @@ public interface WxWebLogService { | |||
| void deleteById(Long id); | |||
| void deleteAll(); | |||
| /** | |||
| * 根据积分获取会员等级 | |||
| * @param tenantId | |||
| * @param score | |||
| * @return | |||
| */ | |||
| String getLevel(String tenantId,int score); | |||
| @@ -54,8 +54,13 @@ public interface WxMerchantTradeDailyService { | |||
| */ | |||
| public ResultData getVolume(Long userId); | |||
| /** | |||
| * 获取近7日解单数据 | |||
| */ | |||
| public ResultData getVolumeOfWeek(Long userId); | |||
| } | |||
| @@ -37,6 +37,23 @@ public interface WxScoreRulesService { | |||
| * @param id | |||
| */ | |||
| void deleteById(Long id); | |||
| /** | |||
| * 登录 调用增长积分 | |||
| * @param tenantId | |||
| * @param cUserId | |||
| * @return 新增的积分值 | |||
| */ | |||
| int loginAddScore(String tenantId,Long cUserId); | |||
| /** | |||
| * | |||
| * @param tenantId | |||
| * @param cUserId | |||
| * @param payPrice 实际支付金额(分) | |||
| * @return | |||
| */ | |||
| int payAddScore(String tenantId,Long cUserId,int payPrice); | |||
| @@ -15,7 +15,9 @@ public interface WxShopService { | |||
| * @return | |||
| */ | |||
| PageInfo<WxShop> listAsPage(WxShop record, Integer pageIndex, Integer pageSize); | |||
| PageInfo<Map<String,Object>> listMapAsPage(WxShop record, Integer pageIndex, Integer pageSize); | |||
| /** | |||
| * 根据Id获得实体 | |||
| * | |||
| @@ -90,6 +90,9 @@ public class CouponInjectServiceImpl implements CouponInjectService { | |||
| record.setStatus(0); | |||
| } | |||
| List<WxCUser> cUsers = wxCUserTagsService.findUserByTag(tagids); | |||
| if(cUsers.isEmpty()){ | |||
| return new ResultData(Result.ERROR,"标签下没有用户"); | |||
| } | |||
| int inventory = wxCoupon.getRemainInventory();//库存数量 | |||
| if(cUsers.size()>inventory){ | |||
| return new ResultData(Result.ERROR,"库存不足"); | |||
| @@ -0,0 +1,118 @@ | |||
| package com.simple.service.impl; | |||
| import com.simple.domain.po.WxMerchant; | |||
| import com.simple.domain.po.WxMerchantTradeDaily; | |||
| import com.simple.domain.po.WxShop; | |||
| import com.simple.mapper.WxDateAmountRecordMapper; | |||
| import com.simple.mapper.WxMerchantMapper; | |||
| import com.simple.mapper.WxMerchantTradeDailyMapper; | |||
| import com.simple.mapper.WxShopMapper; | |||
| import com.simple.service.DataTowerService; | |||
| import com.simple.utils.DateUtils; | |||
| import org.apache.log4j.Logger; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.stereotype.Service; | |||
| import java.math.BigDecimal; | |||
| import java.util.*; | |||
| import java.util.stream.Collectors; | |||
| @Service | |||
| public class DataTowerServiceImpl implements DataTowerService { | |||
| private Logger logger = Logger.getLogger(getClass()); | |||
| @Autowired | |||
| WxShopMapper wxShopMapper; | |||
| @Autowired | |||
| WxMerchantMapper wxMerchantMapper; | |||
| @Autowired | |||
| WxMerchantTradeDailyMapper wxMerchantTradeDailyMapper; | |||
| @Autowired | |||
| WxDateAmountRecordMapper wxDateAmountRecordMapper; | |||
| @Override | |||
| public Map<String, Object> queryRunning(String tenantId) { | |||
| WxShop wxShop = new WxShop(); | |||
| wxShop.setTenantId(tenantId); | |||
| wxShop.setStatus(1); | |||
| List<WxShop> yczlist = wxShopMapper.findList(wxShop); | |||
| wxShop.setStatus(0); | |||
| List<WxShop> wczlist = wxShopMapper.findList(wxShop); | |||
| //出租与未出租 | |||
| HashMap<String, Object> datamap = new HashMap<>(); | |||
| int yczsize = yczlist.size(); | |||
| int wczsize = wczlist.size(); | |||
| int size = yczsize + wczsize; | |||
| if(size==0){ | |||
| datamap.put("yczsl",0); | |||
| datamap.put("wczsl",0); | |||
| datamap.put("yczl",0); | |||
| datamap.put("wczl",0); | |||
| }else{ | |||
| datamap.put("yczsl",yczsize); | |||
| datamap.put("wczsl",wczsize); | |||
| double yczld=((double)yczsize/size)*100; | |||
| double dczl = new BigDecimal(yczld).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); | |||
| double wczld = ((double) wczsize / size) * 100; | |||
| double wczl = new BigDecimal(wczld).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); | |||
| datamap.put("yczl", dczl+"%"); | |||
| datamap.put("wczl", wczl+"%"); | |||
| } | |||
| //上报 | |||
| WxMerchant wxMerchant = new WxMerchant(); | |||
| wxMerchant.setTenantId(tenantId); | |||
| wxMerchant.setStatus(1); | |||
| List<WxMerchant> merchants = wxMerchantMapper.findList(wxMerchant); | |||
| WxMerchantTradeDaily wxMerchantTradeDaily = new WxMerchantTradeDaily(); | |||
| wxMerchantTradeDaily.setTenantId(tenantId); | |||
| String reportdate = DateUtils.getTimeBefore(1, new Date()); | |||
| wxMerchantTradeDaily.setReportDate(reportdate); | |||
| List<WxMerchantTradeDaily> tradelist = wxMerchantTradeDailyMapper.findList(wxMerchantTradeDaily); | |||
| int merchantsize = merchants.size(); | |||
| int tradesize = tradelist.size(); | |||
| if(merchantsize>0 && tradesize>0){ | |||
| double shsbld = ((double)tradesize/merchantsize)*100; | |||
| double shsbl = new BigDecimal(shsbld).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); | |||
| datamap.put("shsbl",shsbl+"%"); | |||
| }else{ | |||
| datamap.put("shsbl",0); | |||
| } | |||
| int shsbjg = tradelist.stream().mapToInt(WxMerchantTradeDaily::getTradeAmt).sum(); | |||
| datamap.put("shsbjg",shsbjg); | |||
| List<Map<String,Object>> recordlist=wxDateAmountRecordMapper.queryprice(tenantId); | |||
| Map<Object, Object> collect = recordlist.stream().collect(Collectors.toMap(m -> { | |||
| return m.get("date"); | |||
| }, m -> { | |||
| return m.get("price"); | |||
| })); | |||
| TreeMap<Object, Object> recordmap = new TreeMap<>(); | |||
| recordmap.putAll(collect); | |||
| /*WxDateAmountRecord wxDateAmountRecord = new WxDateAmountRecord(); | |||
| wxDateAmountRecord.setTenantId(tenantId); | |||
| wxDateAmountRecord.setType(0); | |||
| List<WxDateAmountRecord> records = wxDateAmountRecordMapper.findList(wxDateAmountRecord); | |||
| Map<Date, Integer> recordmap = records.stream(). | |||
| collect(Collectors.groupingBy(WxDateAmountRecord::getDate, | |||
| TreeMap::new, | |||
| Collectors.summingInt(r -> { | |||
| return r.getPayPrice().intValue(); | |||
| })));*/ | |||
| datamap.put("records",recordmap); | |||
| return datamap; | |||
| } | |||
| } | |||
| @@ -17,7 +17,9 @@ public class MallRolePermissionServiceImpl implements MallRolePermissionService | |||
| @Autowired | |||
| MallRolePermissionMapper mallUserRolePermissionMapper; | |||
| @Override | |||
| public PageInfo<MallRolePermission> listAsPage(MallRolePermission record, Integer pageIndex, Integer pageSize) { | |||
| @@ -49,18 +51,25 @@ public class MallRolePermissionServiceImpl implements MallRolePermissionService | |||
| @Override | |||
| public void savePermissions(Long roleId, Long[] perId) { | |||
| Map<String,Object> map = new HashMap<>(); | |||
| map.put("roleId", roleId); | |||
| mallUserRolePermissionMapper.deleteByRoleId(map); | |||
| public void savePermissions(String tenantId,Long roleId, Long[] perId) { | |||
| // Map<String,Object> map = new HashMap<>(); | |||
| // map.put("roleId", roleId); | |||
| mallUserRolePermissionMapper.deleteByRoleId(roleId); | |||
| for(Long pId:perId){ | |||
| MallRolePermission permission =new MallRolePermission(); | |||
| permission.setId(roleId); | |||
| final IdWorker idWorker = IdWorker.get(); | |||
| permission.setId(idWorker.nextId()); | |||
| permission.setPermissionId(pId); | |||
| permission.setTenantId(tenantId); | |||
| permission.setRoleId(roleId); | |||
| mallUserRolePermissionMapper.insert(permission); | |||
| } | |||
| } | |||
| public void deleteByRoleId(Long roleId) { | |||
| mallUserRolePermissionMapper.deleteByRoleId(roleId); | |||
| } | |||
| @@ -57,7 +57,9 @@ public class MallRoleServiceImpl implements MallRoleService { | |||
| public int countByName(String name,Long id) { | |||
| Map<String,Object> map = new HashMap<>(2); | |||
| map.put("name", name); | |||
| map.put("id", id); | |||
| if(id!=null) { | |||
| map.put("id", id); | |||
| } | |||
| return mallRoleMapper.countByName(map); | |||
| } | |||
| @@ -52,6 +52,12 @@ public class MallUserRoleServiceImpl implements MallUserRoleService { | |||
| public void batchInsert(List<MallUserRole> u2rs) { | |||
| mallUserRoleMapper.insertList(u2rs); | |||
| } | |||
| @Override | |||
| public void deleteByUserId(Long uid) { | |||
| mallUserRoleMapper.deleteByUserId(uid); | |||
| } | |||
| @@ -1,47 +1,46 @@ | |||
| package com.simple.service.impl; | |||
| import java.util.*; | |||
| import com.github.pagehelper.PageHelper; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.simple.domain.po.WxBanners; | |||
| import com.simple.mapper.WxBannersMapper; | |||
| import com.simple.service.WxBannersService; | |||
| import com.simple.common.IdWorker; | |||
| import com.simple.domain.po.PushLimit; | |||
| import com.simple.mapper.PushLimitMapper; | |||
| import com.simple.service.PushLimitService; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.stereotype.Service; | |||
| import com.simple.common.IdWorker; | |||
| @Service | |||
| public class WxBannersServiceImpl implements WxBannersService { | |||
| public class PushLimitServiceImpl implements PushLimitService { | |||
| @Autowired | |||
| WxBannersMapper wxBannersMapper; | |||
| PushLimitMapper pushLimitMapper; | |||
| @Override | |||
| public PageInfo<WxBanners> listAsPage(WxBanners record, Integer pageIndex, Integer pageSize) { | |||
| return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxBannersMapper.findList(record)); | |||
| public PageInfo<PushLimit> listAsPage(PushLimit record, Integer pageIndex, Integer pageSize) { | |||
| return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> pushLimitMapper.findList(record)); | |||
| } | |||
| @Override | |||
| public WxBanners getById(Long id) { | |||
| return wxBannersMapper.selectByPrimaryKey(id); | |||
| public PushLimit getById(Long id) { | |||
| return pushLimitMapper.selectByPrimaryKey(id); | |||
| } | |||
| @Override | |||
| public void saveOrUpdate(WxBanners record) { | |||
| public void saveOrUpdate(PushLimit record) { | |||
| if (record.getId() == null) { | |||
| //record.setId(UUID.randomUUID().toString().replaceAll("-", "")); | |||
| final IdWorker idWorker = IdWorker.get(); | |||
| IdWorker idWorker = new IdWorker(0, 0); | |||
| record.setId(idWorker.nextId()); | |||
| wxBannersMapper.insertSelective(record); | |||
| pushLimitMapper.insertSelective(record); | |||
| } else { | |||
| wxBannersMapper.updateByPrimaryKeySelective(record); | |||
| pushLimitMapper.updateByPrimaryKeySelective(record); | |||
| } | |||
| } | |||
| @Override | |||
| public void deleteById(Long id) { | |||
| wxBannersMapper.deleteByPrimaryKey(id); | |||
| pushLimitMapper.deleteByPrimaryKey(id); | |||
| } | |||
| @@ -0,0 +1,72 @@ | |||
| package com.simple.service.impl; | |||
| import java.util.*; | |||
| import com.github.pagehelper.PageHelper; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.simple.domain.po.WxAdminLog; | |||
| import com.simple.mapper.WxAdminLogMapper; | |||
| import com.simple.service.WxAdminLogService; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.stereotype.Service; | |||
| import com.simple.common.IdWorker; | |||
| @Service | |||
| public class WxAdminLogServiceImpl implements WxAdminLogService { | |||
| @Autowired | |||
| WxAdminLogMapper wxAdminLogMapper; | |||
| @Override | |||
| public PageInfo<WxAdminLog> listAsPage(WxAdminLog record, Integer pageIndex, Integer pageSize) { | |||
| return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxAdminLogMapper.findList(record)); | |||
| } | |||
| @Override | |||
| public WxAdminLog getById(Long id) { | |||
| return wxAdminLogMapper.selectByPrimaryKey(id); | |||
| } | |||
| @Override | |||
| public void saveOrUpdate(WxAdminLog record) { | |||
| if (record.getId() == null) { | |||
| //record.setId(UUID.randomUUID().toString().replaceAll("-", "")); | |||
| final IdWorker idWorker = IdWorker.get(); | |||
| record.setId(idWorker.nextId()); | |||
| wxAdminLogMapper.insertSelective(record); | |||
| } else { | |||
| wxAdminLogMapper.updateByPrimaryKeySelective(record); | |||
| } | |||
| } | |||
| @Override | |||
| public void deleteById(Long id) { | |||
| wxAdminLogMapper.deleteByPrimaryKey(id); | |||
| } | |||
| @Override | |||
| public void saveLogCount(WxAdminLog record) { | |||
| // TODO use redis to optimize | |||
| WxAdminLog reqQ = new WxAdminLog(); | |||
| reqQ.setTenantId(record.getTenantId()); | |||
| reqQ.setUrl(record.getUrl()); | |||
| reqQ.setType(record.getType()); | |||
| reqQ.setActionDate(record.getActionDate()); | |||
| List<WxAdminLog> logList = wxAdminLogMapper.select(reqQ); | |||
| if (logList.size() > 0) { | |||
| WxAdminLog log = logList.get(0); | |||
| log.setCount(log.getCount() + 1); | |||
| wxAdminLogMapper.updateByPrimaryKeySelective(log); | |||
| } else { | |||
| final IdWorker idWorker = IdWorker.get(); | |||
| reqQ.setId(idWorker.nextId()); | |||
| reqQ.setCount(1); | |||
| wxAdminLogMapper.insertSelective(reqQ); | |||
| } | |||
| } | |||
| } | |||
| @@ -30,9 +30,14 @@ public class WxCUserBasicInfoServiceImpl implements WxCUserBasicInfoService { | |||
| return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxCUserBasicInfoMapper.list(record)); | |||
| } | |||
| @Override | |||
| public void updateScore(WxCUserBasicInfo record) { | |||
| wxCUserBasicInfoMapper.updateScore(record); | |||
| } | |||
| @Override | |||
| @Override | |||
| public WxCUserBasicInfo getById(Long id) { | |||
| return wxCUserBasicInfoMapper.selectByPrimaryKey(id); | |||
| } | |||
| @@ -27,6 +27,11 @@ public class WxCUserCarServiceImpl implements WxCUserCarService { | |||
| return wxCUserCarMapper.findList(record); | |||
| } | |||
| @Override | |||
| public Integer countUserCar(WxCUserCar record) { | |||
| return wxCUserCarMapper.selectCount(record); | |||
| } | |||
| @Override | |||
| public WxCUserCar getOne(WxCUserCar record) { | |||
| List<WxCUserCar> userCarList = wxCUserCarMapper.findList(record); | |||
| @@ -42,6 +47,17 @@ public class WxCUserCarServiceImpl implements WxCUserCarService { | |||
| return wxCUserCarMapper.selectByPrimaryKey(id); | |||
| } | |||
| @Override | |||
| public Long getNewCarID() { | |||
| final IdWorker idWorker = IdWorker.get(); | |||
| return idWorker.nextId(); | |||
| } | |||
| @Override | |||
| public void save(WxCUserCar record) { | |||
| wxCUserCarMapper.insertSelective(record); | |||
| } | |||
| @Override | |||
| public void saveOrUpdate(WxCUserCar record) { | |||
| if (record.getId() == null) { | |||
| @@ -5,6 +5,7 @@ import java.util.HashMap; | |||
| import java.util.List; | |||
| import java.util.Map; | |||
| import com.alibaba.fastjson.JSON; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.stereotype.Service; | |||
| @@ -62,12 +63,14 @@ public class WxCUserTagsServiceImpl implements WxCUserTagsService { | |||
| @Override | |||
| public long findCountByTag(List<Long> tagIds) { | |||
| return wxCUserTagsMapper.findCountByTag(tagIds); | |||
| String str = JSON.toJSONString(tagIds); | |||
| return wxCUserTagsMapper.findCountByTags(str); | |||
| } | |||
| @Override | |||
| public List<WxCUser> findUserByTag(List<Long> tagIds) { | |||
| List<Long> userIds = wxCUserTagsMapper.findUserByTag(tagIds); | |||
| String str = JSON.toJSONString(tagIds); | |||
| List<Long> userIds = wxCUserTagsMapper.findUserByTags(str); | |||
| if(userIds.size()==0) { | |||
| return new ArrayList<>(); | |||
| } | |||
| @@ -6,16 +6,12 @@ import com.simple.common.ErrorCode; | |||
| import com.simple.common.IdWorker; | |||
| import com.simple.common.Result; | |||
| import com.simple.common.ResultData; | |||
| import com.simple.domain.po.MallUserInfo; | |||
| import com.simple.domain.po.WxCouponOrder; | |||
| import com.simple.domain.po.WxMerchantBUser; | |||
| import com.simple.domain.po.WxOrder; | |||
| import com.simple.domain.po.*; | |||
| import com.simple.domain.vo.WxCouponOrderCVo; | |||
| import com.simple.enums.EnumCouponOrderStatus; | |||
| import com.simple.enums.EnumCouponStatus; | |||
| import com.simple.exception.MallinkException; | |||
| import com.simple.mapper.WxOrderMapper; | |||
| import com.simple.mapper.WxCouponOrderMapper; | |||
| import com.simple.mapper.WxMerchantBUserMapper; | |||
| import com.simple.mapper.*; | |||
| import com.simple.service.WxCouponOrderService; | |||
| import org.apache.log4j.Logger; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| @@ -23,7 +19,9 @@ import org.springframework.stereotype.Service; | |||
| import org.springframework.transaction.annotation.Propagation; | |||
| import org.springframework.transaction.annotation.Transactional; | |||
| import java.util.Date; | |||
| import java.text.ParseException; | |||
| import java.text.SimpleDateFormat; | |||
| import java.util.*; | |||
| @Service | |||
| public class WxCouponOrderServiceImpl implements WxCouponOrderService { | |||
| @@ -35,9 +33,15 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService { | |||
| @Autowired | |||
| WxOrderMapper wxOrderMapper; | |||
| @Autowired | |||
| WxMerchantMapper wxMerchantMapper; | |||
| @Autowired | |||
| WxMerchantBUserMapper wxMerchantBUserMapper; | |||
| @Autowired | |||
| WxCUserMapper wxCUserMapper; | |||
| @Override | |||
| public PageInfo<WxCouponOrder> listAsPage(WxCouponOrder record, Integer pageIndex, Integer pageSize) { | |||
| return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxCouponOrderMapper.findList(record)); | |||
| @@ -74,6 +78,138 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService { | |||
| } | |||
| @Override | |||
| public ResultData listOnDateAsPage(Long bUserId, String date, Integer pageIndex, Integer pageSize, boolean isVerified) { | |||
| WxMerchantBUser wxMerchantBUser = wxMerchantBUserMapper.selectByPrimaryKey(bUserId.longValue()); | |||
| if (wxMerchantBUser == null) { | |||
| logger.error("核销员不存在:" + bUserId); | |||
| throw new MallinkException(ErrorCode.MERCHANT_INFO_NOT_FOUND); | |||
| } | |||
| WxMerchant wxMerchant = wxMerchantMapper.selectByPrimaryKey(wxMerchantBUser.getMerchantId()); | |||
| if (wxMerchant == null) { | |||
| logger.error("商户不存在:" + bUserId); | |||
| throw new MallinkException(ErrorCode.MERCHANT_INFO_NOT_FOUND); | |||
| } | |||
| SimpleDateFormat fmt = new SimpleDateFormat("yyyy-MM-dd"); | |||
| String dateString; | |||
| Date startDate; | |||
| Date endDate; | |||
| if (date == null) { | |||
| endDate = new Date(); | |||
| dateString = fmt.format(new Date()); | |||
| try { | |||
| startDate = fmt.parse(dateString); | |||
| } catch (ParseException e) { | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_CAST_ERROR); | |||
| } | |||
| } | |||
| else { | |||
| try { | |||
| startDate = fmt.parse(date); | |||
| } catch (ParseException e) { | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_CAST_ERROR); | |||
| } | |||
| Calendar cal = Calendar.getInstance(); | |||
| cal.setTime(startDate); | |||
| cal.add(Calendar.DATE,1); | |||
| endDate = cal.getTime(); | |||
| } | |||
| Map dateMap = new HashMap(); | |||
| dateMap.put("startDate", startDate); | |||
| dateMap.put("endDate", endDate); | |||
| dateMap.put("merchantID", wxMerchant.getId()); | |||
| Map resultMap = new HashMap(); | |||
| if (pageIndex == null || pageSize == null) { | |||
| List<WxCouponOrder> list; | |||
| if(isVerified) | |||
| list = wxCouponOrderMapper.findListOfVerifiedByDate(dateMap); | |||
| else | |||
| list = wxCouponOrderMapper.findListOfUnverifiedByDate(dateMap); | |||
| logger.info("find " + list.size() + " coupon order from " + startDate + " to " + new Date()); | |||
| int total_price = 0; | |||
| for (WxCouponOrder couponOrder : list) { | |||
| total_price = total_price + couponOrder.getCouponPrice(); | |||
| } | |||
| resultMap.put("amount", total_price); | |||
| } | |||
| else { | |||
| if (isVerified) | |||
| resultMap.put("list", PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxCouponOrderMapper.findListOfVerifiedByDateForBUser(dateMap))); | |||
| else | |||
| resultMap.put("list", PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxCouponOrderMapper.findListOfUnverifiedByDateForBUser(dateMap))); | |||
| } | |||
| return new ResultData(resultMap); | |||
| } | |||
| @Override | |||
| public ResultData listCUserVoAsPage(Long cUserId, Integer status, Integer pageIndex, Integer pageSize) { | |||
| WxCUser wxCuser = wxCUserMapper.selectByPrimaryKey(cUserId); | |||
| if(wxCuser == null){ | |||
| logger.error("用户不存在:"+ cUserId); | |||
| throw new MallinkException(ErrorCode.USER_IS_EMPTY); | |||
| } | |||
| Map paramMap = new HashMap(); | |||
| paramMap.put("cUserId", cUserId); | |||
| paramMap.put("tenantId", wxCuser.getTenantId()); | |||
| if (status != null) | |||
| paramMap.put("status", status); | |||
| return new ResultData(PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxCouponOrderMapper.findListOfCUser(paramMap))); | |||
| } | |||
| @Override | |||
| public ResultData detailCUserVo(Long cUserId, String couponOrderId) { | |||
| WxCUser wxCuser = wxCUserMapper.selectByPrimaryKey(cUserId); | |||
| if(wxCuser == null){ | |||
| logger.error("用户不存在:"+ cUserId); | |||
| throw new MallinkException(ErrorCode.USER_IS_EMPTY); | |||
| } | |||
| Map paramMap = new HashMap(); | |||
| paramMap.put("cUserId", cUserId); | |||
| paramMap.put("tenantId", wxCuser.getTenantId()); | |||
| paramMap.put("couponOrderId", couponOrderId); | |||
| WxCouponOrderCVo wxCouponOrderCVo = wxCouponOrderMapper.selectDetailOfCUser(paramMap); | |||
| if (wxCouponOrderCVo == null) | |||
| return new ResultData(ErrorCode.COUPON_ORDER_IS_NULL); | |||
| return new ResultData(wxCouponOrderCVo); | |||
| } | |||
| @Override | |||
| public ResultData detailBUserVo(Long bUserId, String couponOrderId) { | |||
| WxMerchantBUser wxMerchantBUser = wxMerchantBUserMapper.selectByPrimaryKey(bUserId); | |||
| if(wxMerchantBUser == null){ | |||
| logger.error("用户不存在:"+ bUserId); | |||
| throw new MallinkException(ErrorCode.USER_IS_EMPTY); | |||
| } | |||
| WxMerchant wxMerchant = wxMerchantMapper.selectByPrimaryKey(wxMerchantBUser.getMerchantId()); | |||
| if (wxMerchant == null) { | |||
| logger.error("商户不存在:" + bUserId); | |||
| throw new MallinkException(ErrorCode.MERCHANT_INFO_NOT_FOUND); | |||
| } | |||
| Map paramMap = new HashMap(); | |||
| paramMap.put("merchantId", wxMerchant.getId()); | |||
| paramMap.put("tenantId", wxMerchant.getTenantId()); | |||
| paramMap.put("couponOrderId", couponOrderId); | |||
| WxCouponOrderCVo wxCouponOrderCVo = wxCouponOrderMapper.selectDetailOfCUser(paramMap); | |||
| if (wxCouponOrderCVo == null) | |||
| return new ResultData(ErrorCode.COUPON_ORDER_IS_NULL); | |||
| return new ResultData(wxCouponOrderCVo); | |||
| } | |||
| @Override | |||
| @Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class}) | |||
| public ResultData verify(Long couponOrderId, Long bUserId) { | |||
| @@ -4,7 +4,7 @@ import java.util.*; | |||
| import com.github.pagehelper.PageHelper; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.simple.domain.po.WxCoupon; | |||
| import com.simple.domain.vo.CouponListReq; | |||
| import com.simple.domain.vo.WxCouponCVo; | |||
| import com.simple.mapper.WxCouponMapper; | |||
| import com.simple.service.WxCouponService; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| @@ -61,5 +61,13 @@ public class WxCouponServiceImpl implements WxCouponService { | |||
| return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxCouponMapper.findCanSendList(record)); | |||
| } | |||
| @Override | |||
| public PageInfo<WxCouponCVo> findListForCUser(WxCoupon record, Integer pageIndex, Integer pageSize) { | |||
| return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxCouponMapper.findListForCUser(record)); | |||
| } | |||
| @Override | |||
| public WxCouponCVo selectDetailForCUser(WxCoupon record) { | |||
| return wxCouponMapper.selectDetailForCUser(record); | |||
| } | |||
| } | |||
| @@ -1,54 +0,0 @@ | |||
| package com.simple.service.impl; | |||
| import java.util.*; | |||
| import com.github.pagehelper.PageHelper; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.simple.domain.po.WxCouponVerify; | |||
| import com.simple.mapper.WxCouponVerifyMapper; | |||
| import com.simple.service.WxCouponVerifyService; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.stereotype.Service; | |||
| import com.simple.common.IdWorker; | |||
| @Service | |||
| public class WxCouponVerifyServiceImpl implements WxCouponVerifyService { | |||
| @Autowired | |||
| WxCouponVerifyMapper wxCouponVerifyMapper; | |||
| @Override | |||
| public PageInfo<WxCouponVerify> listAsPage(WxCouponVerify record, Integer pageIndex, Integer pageSize) { | |||
| return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxCouponVerifyMapper.findList(record)); | |||
| } | |||
| @Override | |||
| public WxCouponVerify getById(Long id) { | |||
| return wxCouponVerifyMapper.selectByPrimaryKey(id); | |||
| } | |||
| @Override | |||
| public void saveOrUpdate(WxCouponVerify record) { | |||
| if (record.getId() == null) { | |||
| //record.setId(UUID.randomUUID().toString().replaceAll("-", "")); | |||
| final IdWorker idWorker = IdWorker.get(); | |||
| record.setId(idWorker.nextId()); | |||
| wxCouponVerifyMapper.insertSelective(record); | |||
| } else { | |||
| wxCouponVerifyMapper.updateByPrimaryKeySelective(record); | |||
| } | |||
| } | |||
| @Override | |||
| public void deleteById(Long id) { | |||
| wxCouponVerifyMapper.deleteByPrimaryKey(id); | |||
| } | |||
| } | |||
| @@ -0,0 +1,59 @@ | |||
| package com.simple.service.impl; | |||
| import java.util.*; | |||
| import com.github.pagehelper.PageHelper; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.simple.domain.po.WxLevelConfig; | |||
| import com.simple.mapper.WxLevelConfigMapper; | |||
| import com.simple.service.WxLevelConfigService; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.stereotype.Service; | |||
| import com.simple.common.IdWorker; | |||
| @Service | |||
| public class WxLevelConfigServiceImpl implements WxLevelConfigService { | |||
| @Autowired | |||
| WxLevelConfigMapper wxLevelConfigMapper; | |||
| @Override | |||
| public PageInfo<WxLevelConfig> listAsPage(WxLevelConfig record, Integer pageIndex, Integer pageSize) { | |||
| return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxLevelConfigMapper.findList(record)); | |||
| } | |||
| @Override | |||
| public WxLevelConfig getById(Long id) { | |||
| return wxLevelConfigMapper.selectByPrimaryKey(id); | |||
| } | |||
| @Override | |||
| public void saveOrUpdate(WxLevelConfig record) { | |||
| if (record.getId() == null) { | |||
| //record.setId(UUID.randomUUID().toString().replaceAll("-", "")); | |||
| IdWorker idWorker = new IdWorker(0, 0); | |||
| record.setId(idWorker.nextId()); | |||
| wxLevelConfigMapper.insertSelective(record); | |||
| } else { | |||
| wxLevelConfigMapper.updateByPrimaryKeySelective(record); | |||
| } | |||
| } | |||
| @Override | |||
| public void deleteById(Long id) { | |||
| wxLevelConfigMapper.deleteByPrimaryKey(id); | |||
| } | |||
| @Override | |||
| public void deleteAll() { | |||
| wxLevelConfigMapper.deleteAll(); | |||
| } | |||
| @Override | |||
| public String getLevel(String tenantId, int score) { | |||
| return wxLevelConfigMapper.getLevel(tenantId,score); | |||
| } | |||
| } | |||
| @@ -149,7 +149,42 @@ public class WxMerchantTradeDailyServiceImpl implements WxMerchantTradeDailyServ | |||
| return new ResultData(ErrorCode.DALIY_REPORT_VOLUME_TODAY_NULL); | |||
| } | |||
| @Override | |||
| public ResultData getVolumeOfWeek(Long userId) { | |||
| WxMerchantBUser user = wxMerchantBUserService.getById(userId); | |||
| if (user==null) | |||
| return new ResultData(ErrorCode.USER_IS_EMPTY); | |||
| WxMerchant merchant = wxMerchantService.getById(user.getMerchantId()); | |||
| if (merchant==null) | |||
| return new ResultData(ErrorCode.MERCHANT_INFO_NOT_FOUND); | |||
| WxMall mall = wxMallService.getByTenantId(merchant.getTenantId()); | |||
| if (mall==null) | |||
| return new ResultData(ErrorCode.MERCHANT_INFO_NOT_FOUND); | |||
| WxMerchantTradeDaily wxMerchantTradeDaily = new WxMerchantTradeDaily(); | |||
| wxMerchantTradeDaily.setMerchantId(merchant.getId()); | |||
| SimpleDateFormat fmt=new SimpleDateFormat("yyyy-MM-dd"); | |||
| wxMerchantTradeDaily.setReportDate(fmt.format(new Date())); | |||
| List<WxMerchantTradeDaily> tradeList = wxMerchantTradeDailyMapper.findListOfWeek(wxMerchantTradeDaily); | |||
| if (tradeList.size() > 0 ) { | |||
| return new ResultData(tradeList); | |||
| } | |||
| return new ResultData(ErrorCode.DALIY_REPORT_VOLUME_WEEK_NULL); | |||
| } | |||
| @@ -6,8 +6,11 @@ import com.github.pagehelper.PageInfo; | |||
| import com.simple.common.IdWorker; | |||
| import com.simple.common.Result; | |||
| import com.simple.common.ResultData; | |||
| import com.simple.domain.po.WxCUser; | |||
| import com.simple.domain.po.WxMsg; | |||
| import com.simple.domain.po.WxMsgConfig; | |||
| import com.simple.mapper.WxCUserMapper; | |||
| import com.simple.mapper.WxCUserTagsMapper; | |||
| import com.simple.mapper.WxMsgConfigMapper; | |||
| import com.simple.mapper.WxMsgMapper; | |||
| import com.simple.service.WxMsgService; | |||
| @@ -29,6 +32,12 @@ public class WxMsgServiceImpl implements WxMsgService { | |||
| @Autowired | |||
| WxMsgConfigMapper wxMsgConfigMapper; | |||
| @Autowired | |||
| WxCUserTagsMapper wxCUserTagsMapper; | |||
| @Autowired | |||
| WxCUserMapper wxCUserMapper; | |||
| @Override | |||
| public PageInfo<WxMsg> listAsPage(WxMsg record, Integer pageIndex, Integer pageSize) { | |||
| return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxMsgMapper.findList(record)); | |||
| @@ -55,7 +64,7 @@ public class WxMsgServiceImpl implements WxMsgService { | |||
| } | |||
| if(phones.equals("")){ | |||
| return new ResultData(Result.SUCCESS, "您需要添 加要发送的手机号"); | |||
| return new ResultData(Result.SUCCESS, "您需要添加要发送的手机号"); | |||
| } | |||
| if (wxMsg.getId() == null) { | |||
| @@ -108,8 +117,26 @@ public class WxMsgServiceImpl implements WxMsgService { | |||
| } | |||
| private String parselabel(String label) { | |||
| return null; | |||
| String[] arys = label.split(","); | |||
| List<Long> tagids = new ArrayList<>(); | |||
| for (int i = 0; i < arys.length; i++) { | |||
| tagids.add(Long.parseLong(arys[i])); | |||
| } | |||
| List<Long> userIds = wxCUserTagsMapper.findUserByTag(tagids); | |||
| if(userIds.size()==0) { | |||
| return ""; | |||
| } | |||
| WxCUser wxCUser = new WxCUser(); | |||
| wxCUser.setIds(userIds); | |||
| List<WxCUser> list = wxCUserMapper.findList(wxCUser); | |||
| StringBuilder sb=new StringBuilder(); | |||
| if(list.size()>0){ | |||
| for(WxCUser cuser:list){ | |||
| sb.append(cuser.getPhone()).append(","); | |||
| } | |||
| return sb.toString(); | |||
| } | |||
| return ""; | |||
| } | |||
| private String parseexcle(String excelpath) { | |||