| @@ -34,4 +34,15 @@ public class DataTowerController extends BaseController { | |||||
| } | } | ||||
| @ApiOperation("查询车流") | |||||
| @PostMapping("/queryCar") | |||||
| public ResultData queryCar() { | |||||
| Map<String,Object> data=dataTowerService.queryCar(getTenantId()); | |||||
| return new ResultData(data); | |||||
| } | |||||
| } | } | ||||
| @@ -72,7 +72,7 @@ public class HomeController { | |||||
| if(page.getSize()>0) { | if(page.getSize()>0) { | ||||
| Long roleId = page.getList().get(0).getRoleId(); | Long roleId = page.getList().get(0).getRoleId(); | ||||
| MallRolePermission p = new MallRolePermission(); | MallRolePermission p = new MallRolePermission(); | ||||
| p.setRoleId(p.getRoleId()); | |||||
| p.setRoleId(roleId); | |||||
| p.setTenantId(info.getTenantId()); | p.setTenantId(info.getTenantId()); | ||||
| PageInfo<MallRolePermission> listAsPage = mallRolePermissionService.listAsPage(p, 1, 100); | PageInfo<MallRolePermission> listAsPage = mallRolePermissionService.listAsPage(p, 1, 100); | ||||
| String menus = ""; | String menus = ""; | ||||
| @@ -14,8 +14,12 @@ import org.springframework.web.bind.annotation.RestController; | |||||
| import com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| import com.simple.common.ResultData; | import com.simple.common.ResultData; | ||||
| import com.simple.domain.po.MallRole; | |||||
| import com.simple.domain.po.MallRolePermission; | |||||
| import com.simple.domain.po.MallUserInfo; | import com.simple.domain.po.MallUserInfo; | ||||
| import com.simple.domain.po.MallUserRole; | import com.simple.domain.po.MallUserRole; | ||||
| import com.simple.service.MallRolePermissionService; | |||||
| import com.simple.service.MallRoleService; | |||||
| import com.simple.service.MallUserInfoService; | import com.simple.service.MallUserInfoService; | ||||
| import com.simple.service.MallUserRoleService; | import com.simple.service.MallUserRoleService; | ||||
| import com.simple.shiro.PasswordHelper; | import com.simple.shiro.PasswordHelper; | ||||
| @@ -38,6 +42,14 @@ public class MallUserInfoController { | |||||
| @Autowired | @Autowired | ||||
| MallUserRoleService userRoleService; | MallUserRoleService userRoleService; | ||||
| @Autowired | |||||
| MallRoleService mallRoleService; | |||||
| @Autowired | |||||
| MallUserRoleService mallUserRoleService; | |||||
| @Autowired | |||||
| MallRolePermissionService mallRolePermissionService; | |||||
| @ApiOperation(value = "用户分页接口", response = String.class) | @ApiOperation(value = "用户分页接口", response = String.class) | ||||
| @GetMapping("lists") | @GetMapping("lists") | ||||
| @@ -48,11 +60,12 @@ public class MallUserInfoController { | |||||
| r.setUid(u.getId()); | r.setUid(u.getId()); | ||||
| PageInfo<MallUserRole> ur = userRoleService.listAsPage(r, 1, 1); | PageInfo<MallUserRole> ur = userRoleService.listAsPage(r, 1, 1); | ||||
| if(ur.getSize()>0) { | if(ur.getSize()>0) { | ||||
| u.setRoleId(ur.getList().get(0).getRoleId()); | |||||
| MallRole role = mallRoleService.getById(ur.getList().get(0).getRoleId()); | |||||
| u.setRoleName(role.getName()); | |||||
| u.setRoleId(role.getId()); | |||||
| } | } | ||||
| u.setPassword(null);//不返回密码 | u.setPassword(null);//不返回密码 | ||||
| } | } | ||||
| return new ResultData(page); | return new ResultData(page); | ||||
| } | } | ||||
| @@ -176,6 +189,26 @@ public class MallUserInfoController { | |||||
| @GetMapping("getUser") | @GetMapping("getUser") | ||||
| public ResultData getUserInfo(){ | public ResultData getUserInfo(){ | ||||
| MallUserInfo info =(MallUserInfo) SecurityUtils.getSubject().getSession().getAttribute(UserSession.userInfo); | MallUserInfo info =(MallUserInfo) SecurityUtils.getSubject().getSession().getAttribute(UserSession.userInfo); | ||||
| info.setPassword("保密"); | |||||
| // 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(roleId); | |||||
| p.setTenantId(info.getTenantId()); | |||||
| PageInfo<MallRolePermission> listAsPage = mallRolePermissionService.listAsPage(p, 1, 100); | |||||
| String menus = ""; | |||||
| for(MallRolePermission rp :listAsPage.getList()) { | |||||
| menus+=rp.getPermissionId()+","; | |||||
| } | |||||
| if(menus.length()>0) { | |||||
| menus = menus.substring(0, menus.length()-1); | |||||
| } | |||||
| info.setMenus(menus); | |||||
| } | |||||
| ResultData data = new ResultData(); | ResultData data = new ResultData(); | ||||
| data.data=info; | data.data=info; | ||||
| return data; | return data; | ||||
| @@ -1,19 +1,28 @@ | |||||
| package com.simple.controller; | package com.simple.controller; | ||||
| import org.apache.log4j.Logger; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.web.bind.annotation.GetMapping; | |||||
| import org.springframework.web.bind.annotation.ModelAttribute; | |||||
| import org.springframework.web.bind.annotation.PostMapping; | |||||
| import org.springframework.web.bind.annotation.RequestBody; | |||||
| import org.springframework.web.bind.annotation.RequestMapping; | |||||
| import org.springframework.web.bind.annotation.RestController; | |||||
| import com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| import com.simple.common.Result; | import com.simple.common.Result; | ||||
| import com.simple.common.ResultData; | import com.simple.common.ResultData; | ||||
| import com.simple.domain.po.PushLimit; | import com.simple.domain.po.PushLimit; | ||||
| import com.simple.service.PushLimitService; | import com.simple.service.PushLimitService; | ||||
| import io.swagger.annotations.Api; | |||||
| import io.swagger.annotations.ApiImplicitParam; | import io.swagger.annotations.ApiImplicitParam; | ||||
| import io.swagger.annotations.ApiImplicitParams; | import io.swagger.annotations.ApiImplicitParams; | ||||
| import io.swagger.annotations.ApiOperation; | import io.swagger.annotations.ApiOperation; | ||||
| import org.apache.log4j.Logger; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.web.bind.annotation.*; | |||||
| @RestController | @RestController | ||||
| @RequestMapping("pushLimit") | @RequestMapping("pushLimit") | ||||
| @Api(description="疲劳度相关接口") | |||||
| public class PushLimitController extends BaseController | public class PushLimitController extends BaseController | ||||
| { | { | ||||
| @Autowired | @Autowired | ||||
| @@ -23,12 +32,10 @@ public class PushLimitController extends BaseController | |||||
| @ApiOperation("分页列表接口") | @ApiOperation("分页列表接口") | ||||
| @GetMapping("list") | @GetMapping("list") | ||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name="pageNum",value="页数",dataType="int", paramType = "query",required=true), | |||||
| @ApiImplicitParam(name="pageSize",value="每页条数",dataType="int", paramType = "query",required=true)}) | |||||
| public ResultData list(@ModelAttribute PushLimit pushLimit, Integer pageNum, Integer pageSize) { | |||||
| public ResultData list(@ModelAttribute PushLimit pushLimit) { | |||||
| if (null == pushLimit) pushLimit = new PushLimit(); | if (null == pushLimit) pushLimit = new PushLimit(); | ||||
| final PageInfo<PushLimit> page = pushLimitService.listAsPage(pushLimit, pageNum, pageSize); | |||||
| pushLimit.setTenantId(getTenantId()); | |||||
| final PageInfo<PushLimit> page = pushLimitService.listAsPage(pushLimit, 1, 10); | |||||
| return new ResultData(page); | return new ResultData(page); | ||||
| } | } | ||||
| @@ -37,6 +44,7 @@ public class PushLimitController extends BaseController | |||||
| @ApiOperation("根据id更新接口") | @ApiOperation("根据id更新接口") | ||||
| @PostMapping("update") | @PostMapping("update") | ||||
| public ResultData update(@RequestBody PushLimit pushLimit) { | public ResultData update(@RequestBody PushLimit pushLimit) { | ||||
| pushLimit.setMsgAmount(null); | |||||
| pushLimitService.saveOrUpdate(pushLimit); | pushLimitService.saveOrUpdate(pushLimit); | ||||
| return new ResultData(); | return new ResultData(); | ||||
| } | } | ||||
| @@ -1,6 +1,9 @@ | |||||
| package com.simple.controller; | package com.simple.controller; | ||||
| import java.text.NumberFormat; | |||||
| import java.util.ArrayList; | import java.util.ArrayList; | ||||
| import java.util.Calendar; | |||||
| import java.util.Date; | |||||
| import java.util.List; | import java.util.List; | ||||
| import org.apache.commons.lang3.StringUtils; | import org.apache.commons.lang3.StringUtils; | ||||
| @@ -25,6 +28,8 @@ import com.simple.domain.po.WxCUserTags; | |||||
| import com.simple.domain.po.WxCoupon; | import com.simple.domain.po.WxCoupon; | ||||
| import com.simple.domain.po.WxCouponOrder; | import com.simple.domain.po.WxCouponOrder; | ||||
| import com.simple.domain.po.WxTags; | import com.simple.domain.po.WxTags; | ||||
| import com.simple.domain.vo.UserStructureVo; | |||||
| import com.simple.enums.EnumAgeInfo; | |||||
| import com.simple.service.WxCUserBasicInfoService; | import com.simple.service.WxCUserBasicInfoService; | ||||
| import com.simple.service.WxCUserService; | import com.simple.service.WxCUserService; | ||||
| import com.simple.service.WxCUserTagsService; | import com.simple.service.WxCUserTagsService; | ||||
| @@ -149,7 +154,7 @@ public class WxCUserBasicInfoController extends BaseController | |||||
| public ResultData findById(Long id) { | public ResultData findById(Long id) { | ||||
| WxCUserBasicInfo info = wxCUserBasicInfoService.getById(id); | WxCUserBasicInfo info = wxCUserBasicInfoService.getById(id); | ||||
| if(info.getTagId()!=null) { | if(info.getTagId()!=null) { | ||||
| WxCUserTags uTag = wxCUserTagsService.getById(id); | |||||
| WxCUserTags uTag = wxCUserTagsService.getById(info.getTagId()); | |||||
| if(StringUtils.isNotBlank(uTag.getTags())) { | if(StringUtils.isNotBlank(uTag.getTags())) { | ||||
| List<Long> ids = JSONObject.parseArray(uTag.getTags(),Long.class); | List<Long> ids = JSONObject.parseArray(uTag.getTags(),Long.class); | ||||
| WxTags wxTags =new WxTags(); | WxTags wxTags =new WxTags(); | ||||
| @@ -194,4 +199,85 @@ public class WxCUserBasicInfoController extends BaseController | |||||
| } | } | ||||
| return new ResultData(Result.SUCCESS,"查询成功",page); | return new ResultData(Result.SUCCESS,"查询成功",page); | ||||
| } | } | ||||
| @ApiOperation("查询会员性别结构") | |||||
| @GetMapping("/findUserSexStructure") | |||||
| public ResultData findUserSexStructure( | |||||
| Date startTime,Date endTime | |||||
| ) { | |||||
| WxCuerBasicInfoDto dto = new WxCuerBasicInfoDto(); | |||||
| dto.setStartTime(startTime); | |||||
| dto.setEndTime(endTime); | |||||
| //保密 | |||||
| dto.setSex(0); | |||||
| long secrecy = getCount(dto); | |||||
| dto.setSex(1); | |||||
| long boy = getCount(dto); | |||||
| dto.setSex(2); | |||||
| long girl=getCount(dto); | |||||
| Long all =secrecy+boy+girl; | |||||
| List<UserStructureVo> vos = new ArrayList<>(); | |||||
| vos.add(getVo(boy, all, "男",1)); | |||||
| vos.add(getVo(girl, all, "女",2)); | |||||
| vos.add(getVo(secrecy, all, "保密",3)); | |||||
| return new ResultData(vos); | |||||
| } | |||||
| @ApiOperation("查询会员年龄结构") | |||||
| @GetMapping("/findUserAgeStructure") | |||||
| public ResultData findUserAgeStructure( Date startTime,Date endTime) { | |||||
| WxCuerBasicInfoDto dto = new WxCuerBasicInfoDto(); | |||||
| dto.setStartTime(startTime); | |||||
| dto.setEndTime(endTime); | |||||
| long all =wxCUserBasicInfoService.findCountByAge(dto); | |||||
| List<UserStructureVo> vos = new ArrayList<>(); | |||||
| Calendar c = Calendar.getInstance(); | |||||
| for(EnumAgeInfo a:EnumAgeInfo.values()) { | |||||
| c.clear(); | |||||
| c.setTime(new Date()); | |||||
| c.set(Calendar.HOUR_OF_DAY, 0); | |||||
| c.set(Calendar.MINUTE,0); | |||||
| c.set(Calendar.SECOND,0); | |||||
| long count = getCountByAge(a, c,dto); | |||||
| vos.add(getVo(count, all, a.getDesc(),a.getSortNum())); | |||||
| } | |||||
| return new ResultData(vos); | |||||
| } | |||||
| private long getCountByAge(EnumAgeInfo a,Calendar c, WxCuerBasicInfoDto dto ) { | |||||
| c.add(Calendar.YEAR, -a.getEnd()); | |||||
| Date startTime = c.getTime(); | |||||
| c.clear(); | |||||
| c.setTime(startTime); | |||||
| c.add(Calendar.YEAR,a.getEnd()-a.getStart()); | |||||
| Date endTime = c.getTime(); | |||||
| dto.setBirthStartTime(startTime); | |||||
| dto.setBirthEndTime(endTime); | |||||
| return wxCUserBasicInfoService.findCountByAge(dto); | |||||
| } | |||||
| //通过性别获取数量 | |||||
| private long getCount(WxCuerBasicInfoDto dto) { | |||||
| //TODO 考虑性能问题,暂不处理少量重复问题,后续可考虑大数据处理 | |||||
| return wxCUserBasicInfoService.findCountBySex(dto)+ | |||||
| wxCUserService.findCountBySex(dto); | |||||
| } | |||||
| private UserStructureVo getVo(long count,long all,String name,Integer num) { | |||||
| UserStructureVo vo = new UserStructureVo(); | |||||
| vo.setSortNum(num); | |||||
| vo.setName(name); | |||||
| vo.setCount(count+""); | |||||
| NumberFormat nf = NumberFormat.getPercentInstance(); | |||||
| nf.setMinimumFractionDigits(2);//控制保留小数点后几位,2:表示保留2位小数点 | |||||
| if(all>0) { | |||||
| vo.setPercentage(nf.format(new Long(count).doubleValue()/new Long(all).doubleValue())); | |||||
| }else { | |||||
| vo.setPercentage("0.00%"); | |||||
| } | |||||
| return vo; | |||||
| } | |||||
| } | } | ||||
| @@ -101,7 +101,7 @@ public class WxCampaignController extends BaseController | |||||
| WxCoupon wxCoupon = new WxCoupon(); | WxCoupon wxCoupon = new WxCoupon(); | ||||
| wxCoupon.setTenantId(getTenantId()); | wxCoupon.setTenantId(getTenantId()); | ||||
| wxCoupon.setIds(list); | wxCoupon.setIds(list); | ||||
| wxCoupon.setStatus(1); | |||||
| wxCoupon.setStatus(0); | |||||
| List<WxCoupon> couponlist = wxCouponService.findList(wxCoupon); | List<WxCoupon> couponlist = wxCouponService.findList(wxCoupon); | ||||
| wxCampaign.setCoupons(couponlist); | wxCampaign.setCoupons(couponlist); | ||||
| } | } | ||||
| @@ -64,6 +64,15 @@ public class WxCarCallBackController extends BaseController | |||||
| @PostMapping(value = "/etcpParkInCallback") | @PostMapping(value = "/etcpParkInCallback") | ||||
| public Result etcpParkInCallback(@RequestBody Map<String,String> paramMap) { | public Result etcpParkInCallback(@RequestBody Map<String,String> paramMap) { | ||||
| logger.info("etcpParkInCallback: " + paramMap.toString()); | logger.info("etcpParkInCallback: " + paramMap.toString()); | ||||
| Date currentDate = new Date(); | |||||
| WxCarCmdLog wxCarCmdLog = new WxCarCmdLog(); | |||||
| wxCarCmdLog.setVendorType(EnumCarVendor.CAR_ETCP.getCode()); | |||||
| wxCarCmdLog.setCmdType(EnumCarCmd.CAR_ETCP_CALLBACK_PARK_IN.getCode()); | |||||
| wxCarCmdLog.setCmdJson(JSON.toJSONString(paramMap)); | |||||
| wxCarCmdLog.setCreateDate(currentDate); | |||||
| wxCarCmdLog.setUpdateDate(currentDate); | |||||
| String etcpParkId = paramMap.get("parkId"); | String etcpParkId = paramMap.get("parkId"); | ||||
| WxPark parkQ = new WxPark(); | WxPark parkQ = new WxPark(); | ||||
| parkQ.setVendorType(EnumCarVendor.CAR_ETCP.getCode()); | parkQ.setVendorType(EnumCarVendor.CAR_ETCP.getCode()); | ||||
| @@ -71,17 +80,11 @@ public class WxCarCallBackController extends BaseController | |||||
| WxPark park = wxParkService.getByObj(parkQ); | WxPark park = wxParkService.getByObj(parkQ); | ||||
| if (park == null) { | if (park == null) { | ||||
| logger.error("etcpParkInCallback: ETCP车场未找到"+ etcpParkId); | logger.error("etcpParkInCallback: ETCP车场未找到"+ etcpParkId); | ||||
| return new Result(ErrorCode.CAR_PARK_NOT_FOUND.getCode(), "ETCP车场未找到"+ etcpParkId); | |||||
| //return new Result(ErrorCode.CAR_PARK_NOT_FOUND.getCode(), "ETCP车场未找到"+ etcpParkId); | |||||
| } else { | |||||
| wxCarCmdLog.setTenantId(park.getTenantId()); | |||||
| } | } | ||||
| Date currentDate = new Date(); | |||||
| WxCarCmdLog wxCarCmdLog = new WxCarCmdLog(); | |||||
| wxCarCmdLog.setTenantId(park.getTenantId()); | |||||
| wxCarCmdLog.setVendorType(EnumCarVendor.CAR_ETCP.getCode()); | |||||
| wxCarCmdLog.setCmdType(EnumCarCmd.CAR_ETCP_CALLBACK_PARK_IN.getCode()); | |||||
| wxCarCmdLog.setCmdJson(JSON.toJSONString(paramMap)); | |||||
| wxCarCmdLog.setCreateDate(currentDate); | |||||
| wxCarCmdLog.setUpdateDate(currentDate); | |||||
| try { | try { | ||||
| wxCarCmdLogService.saveOrUpdate(wxCarCmdLog); | wxCarCmdLogService.saveOrUpdate(wxCarCmdLog); | ||||
| } catch (Exception e) { | } catch (Exception e) { | ||||
| @@ -114,6 +117,15 @@ public class WxCarCallBackController extends BaseController | |||||
| @PostMapping(value = "/etcpParkOutCallback") | @PostMapping(value = "/etcpParkOutCallback") | ||||
| public Result etcpParkOutCallback(@RequestBody Map<String,String> paramMap) { | public Result etcpParkOutCallback(@RequestBody Map<String,String> paramMap) { | ||||
| logger.info("etcpParkOutCallback: " + paramMap.toString()); | logger.info("etcpParkOutCallback: " + paramMap.toString()); | ||||
| Date currentDate = new Date(); | |||||
| WxCarCmdLog wxCarCmdLog = new WxCarCmdLog(); | |||||
| wxCarCmdLog.setVendorType(EnumCarVendor.CAR_ETCP.getCode()); | |||||
| wxCarCmdLog.setCmdType(EnumCarCmd.CAR_ETCP_CALLBACK_PARK_OUT.getCode()); | |||||
| wxCarCmdLog.setCmdJson(JSON.toJSONString(paramMap)); | |||||
| wxCarCmdLog.setCreateDate(currentDate); | |||||
| wxCarCmdLog.setUpdateDate(currentDate); | |||||
| String etcpParkId = paramMap.get("parkId"); | String etcpParkId = paramMap.get("parkId"); | ||||
| WxPark parkQ = new WxPark(); | WxPark parkQ = new WxPark(); | ||||
| parkQ.setVendorType(EnumCarVendor.CAR_ETCP.getCode()); | parkQ.setVendorType(EnumCarVendor.CAR_ETCP.getCode()); | ||||
| @@ -121,17 +133,11 @@ public class WxCarCallBackController extends BaseController | |||||
| WxPark park = wxParkService.getByObj(parkQ); | WxPark park = wxParkService.getByObj(parkQ); | ||||
| if (park == null) { | if (park == null) { | ||||
| logger.error("etcpParkOutCallback: ETCP车场未找到 "+ etcpParkId); | logger.error("etcpParkOutCallback: ETCP车场未找到 "+ etcpParkId); | ||||
| return new Result(ErrorCode.CAR_PARK_NOT_FOUND.getCode(), "ETCP车场未找到"+ etcpParkId); | |||||
| //return new Result(ErrorCode.CAR_PARK_NOT_FOUND.getCode(), "ETCP车场未找到"+ etcpParkId); | |||||
| } else { | |||||
| wxCarCmdLog.setTenantId(park.getTenantId()); | |||||
| } | } | ||||
| Date currentDate = new Date(); | |||||
| WxCarCmdLog wxCarCmdLog = new WxCarCmdLog(); | |||||
| wxCarCmdLog.setTenantId(park.getTenantId()); | |||||
| wxCarCmdLog.setVendorType(EnumCarVendor.CAR_ETCP.getCode()); | |||||
| wxCarCmdLog.setCmdType(EnumCarCmd.CAR_ETCP_CALLBACK_PARK_OUT.getCode()); | |||||
| wxCarCmdLog.setCmdJson(JSON.toJSONString(paramMap)); | |||||
| wxCarCmdLog.setCreateDate(currentDate); | |||||
| wxCarCmdLog.setUpdateDate(currentDate); | |||||
| try { | try { | ||||
| wxCarCmdLogService.saveOrUpdate(wxCarCmdLog); | wxCarCmdLogService.saveOrUpdate(wxCarCmdLog); | ||||
| } catch (Exception e) { | } catch (Exception e) { | ||||
| @@ -37,20 +37,15 @@ public class WxCouponChannelController extends BaseController | |||||
| @ApiImplicitParam(name="pageSize",value="每页条数",dataType="int", paramType = "query",required=true)}) | @ApiImplicitParam(name="pageSize",value="每页条数",dataType="int", paramType = "query",required=true)}) | ||||
| public ResultData list(@ModelAttribute WxCouponChannel wxCouponChannel,Integer pageNum, Integer pageSize) { | public ResultData list(@ModelAttribute WxCouponChannel wxCouponChannel,Integer pageNum, Integer pageSize) { | ||||
| if (null == wxCouponChannel) wxCouponChannel = new WxCouponChannel(); | if (null == wxCouponChannel) wxCouponChannel = new WxCouponChannel(); | ||||
| if(wxCouponChannel.getStatus()!=null&&wxCouponChannel.getStatus()==-1){ | |||||
| wxCouponChannel.setStatus(null); | |||||
| } | |||||
| wxCouponChannel.setTenantId(getUser().getTenantId()); | wxCouponChannel.setTenantId(getUser().getTenantId()); | ||||
| final PageInfo<WxCouponChannel> page = wxCouponChannelService.listAsPage(wxCouponChannel, pageNum, pageSize); | final PageInfo<WxCouponChannel> page = wxCouponChannelService.listAsPage(wxCouponChannel, pageNum, pageSize); | ||||
| return new ResultData(page); | return new ResultData(page); | ||||
| } | } | ||||
| @ApiOperation("新增接口") | |||||
| @PostMapping("add") | |||||
| public ResultData add(@RequestBody WxCouponChannel wxCouponChannel) { | |||||
| //Assert.notNull(wxCouponChannel.getName(), "角色名不能为空"); | |||||
| //Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名"); | |||||
| wxCouponChannel.setTenantId(getUser().getTenantId()); | |||||
| wxCouponChannelService.saveOrUpdate(wxCouponChannel); | |||||
| return new ResultData(); | |||||
| } | |||||
| @ApiOperation("根据id更新接口") | @ApiOperation("根据id更新接口") | ||||
| @PostMapping("update") | @PostMapping("update") | ||||
| @@ -77,11 +72,11 @@ public class WxCouponChannelController extends BaseController | |||||
| @ApiOperation("批量新增") | @ApiOperation("批量新增") | ||||
| @PostMapping("/addbatch") | @PostMapping("/addbatch") | ||||
| public ResultData findById(@RequestBody WxCouponChannelDto wxCouponChannelDto) { | |||||
| public ResultData addbatch(@RequestBody WxCouponChannelDto wxCouponChannelDto) { | |||||
| String[] ids = wxCouponChannelDto.getCouponIds().split(","); | String[] ids = wxCouponChannelDto.getCouponIds().split(","); | ||||
| String[] channelId = wxCouponChannelDto.getChannelId().split(","); | String[] channelId = wxCouponChannelDto.getChannelId().split(","); | ||||
| MallUserInfo user = getUser(); | MallUserInfo user = getUser(); | ||||
| wxCouponChannelService.addBatch(ids,channelId,user.getTenantId()); | |||||
| wxCouponChannelService.addBatch(ids,channelId,user.getTenantId(),wxCouponChannelDto.getBeginTime(),wxCouponChannelDto.getEndTime()); | |||||
| return new ResultData(); | return new ResultData(); | ||||
| } | } | ||||
| @@ -1,5 +1,7 @@ | |||||
| package com.simple.controller; | package com.simple.controller; | ||||
| import com.simple.domain.po.WxCouponChannel; | |||||
| import com.simple.service.WxCouponChannelService; | |||||
| import org.apache.commons.lang3.StringUtils; | import org.apache.commons.lang3.StringUtils; | ||||
| import org.apache.log4j.Logger; | import org.apache.log4j.Logger; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| @@ -25,6 +27,12 @@ import io.swagger.annotations.ApiImplicitParam; | |||||
| import io.swagger.annotations.ApiImplicitParams; | import io.swagger.annotations.ApiImplicitParams; | ||||
| import io.swagger.annotations.ApiOperation; | import io.swagger.annotations.ApiOperation; | ||||
| import java.util.ArrayList; | |||||
| import java.util.Collections; | |||||
| import java.util.List; | |||||
| import java.util.Map; | |||||
| import java.util.stream.Collectors; | |||||
| @RestController | @RestController | ||||
| @RequestMapping("wxCoupon") | @RequestMapping("wxCoupon") | ||||
| @Api(description="优惠券接口") | @Api(description="优惠券接口") | ||||
| @@ -35,6 +43,8 @@ public class WxCouponController extends BaseController | |||||
| @Autowired | @Autowired | ||||
| private WxMerchantService wxMerchantService; | private WxMerchantService wxMerchantService; | ||||
| @Autowired | |||||
| private WxCouponChannelService wxCouponChannelService; | |||||
| private Logger logger = Logger.getLogger(WxCouponController.class); | private Logger logger = Logger.getLogger(WxCouponController.class); | ||||
| @@ -45,12 +55,51 @@ public class WxCouponController extends BaseController | |||||
| @ApiImplicitParam(name="pageSize",value="每页条数",dataType="int", paramType = "query",required=true)}) | @ApiImplicitParam(name="pageSize",value="每页条数",dataType="int", paramType = "query",required=true)}) | ||||
| public ResultData list(@ModelAttribute WxCoupon wxCoupon,Integer pageNum, Integer pageSize) { | public ResultData list(@ModelAttribute WxCoupon wxCoupon,Integer pageNum, Integer pageSize) { | ||||
| if (null == wxCoupon) wxCoupon = new WxCoupon(); | if (null == wxCoupon) wxCoupon = new WxCoupon(); | ||||
| wxCoupon.setTenantId(getTenantId()); | |||||
| PageInfo<WxCoupon> page = null; | PageInfo<WxCoupon> page = null; | ||||
| if (wxCoupon.getStatus() != null && wxCoupon.getStatus() == -1) { | if (wxCoupon.getStatus() != null && wxCoupon.getStatus() == -1) { | ||||
| page = wxCouponService.findEnableList(wxCoupon, pageNum, pageSize); | page = wxCouponService.findEnableList(wxCoupon, pageNum, pageSize); | ||||
| }else { | }else { | ||||
| page = wxCouponService.listAsPage(wxCoupon, pageNum, pageSize); | page = wxCouponService.listAsPage(wxCoupon, pageNum, pageSize); | ||||
| } | } | ||||
| List<WxCoupon> wxCouponList = page.getList(); | |||||
| if(wxCouponList.isEmpty()){ | |||||
| return new ResultData(page); | |||||
| } | |||||
| List<Long> ids = wxCouponList.stream().map(p->p.getId()).collect(Collectors.toList()); | |||||
| WxCouponChannel wxCouponChannel = new WxCouponChannel(); | |||||
| wxCouponChannel.setTenantId(getTenantId()); | |||||
| wxCouponChannel.setCouponIds(ids); | |||||
| wxCouponChannel.setStatus(0); | |||||
| //上架状态 | |||||
| List<WxCouponChannel> list = wxCouponChannelService.listAsPage(wxCouponChannel,1,5).getList(); | |||||
| if(!list.isEmpty()){ | |||||
| Map<Long, List<WxCouponChannel>> groupBy = list.stream().collect(Collectors.groupingBy(WxCouponChannel::getCouponId)); | |||||
| for (WxCoupon temp:wxCouponList) { | |||||
| if(groupBy.get(temp.getId())!=null){ | |||||
| List<Integer> channels=new ArrayList<>(); | |||||
| for (WxCouponChannel tempchannel:groupBy.get(temp.getId())) { | |||||
| if(!channels.contains(tempchannel.getTargetAd())) { | |||||
| channels.add(tempchannel.getTargetAd()); | |||||
| } | |||||
| } | |||||
| String sss = JSON.toJSONString(channels); | |||||
| temp.setChannels(sss); | |||||
| }else{ | |||||
| temp.setChannels(""); | |||||
| } | |||||
| } | |||||
| }else{ | |||||
| for (WxCoupon temp:wxCouponList) { | |||||
| temp.setChannels(""); | |||||
| } | |||||
| } | |||||
| return new ResultData(page); | return new ResultData(page); | ||||
| } | } | ||||
| @@ -73,6 +122,7 @@ public class WxCouponController extends BaseController | |||||
| wxCoupon.setBusiness(JSON.toJSONString(arys)); | wxCoupon.setBusiness(JSON.toJSONString(arys)); | ||||
| } | } | ||||
| wxCoupon.setTenantId(getUser().getTenantId()); | wxCoupon.setTenantId(getUser().getTenantId()); | ||||
| wxCoupon.setChannels(""); | |||||
| Long id = wxCouponService.saveOrUpdate(wxCoupon); | Long id = wxCouponService.saveOrUpdate(wxCoupon); | ||||
| return new ResultData(id); | return new ResultData(id); | ||||
| } | } | ||||
| @@ -83,20 +133,11 @@ public class WxCouponController extends BaseController | |||||
| if(wxCoupon.getId()==null) { | if(wxCoupon.getId()==null) { | ||||
| return new ResultData(ResultData.ERROR,"缺少id"); | return new ResultData(ResultData.ERROR,"缺少id"); | ||||
| } | } | ||||
| if(wxCoupon.getStatus()!=null){ | |||||
| if(wxCoupon.getStatus()==3){ //已作废 | |||||
| WxCoupon temp = wxCouponService.getById(wxCoupon.getId()); | |||||
| if(temp.getStatus()==1){ | |||||
| return new ResultData(Result.ERROR,"生效的卡券,不能修改"); | |||||
| } | |||||
| } | |||||
| } | |||||
| if(StringUtils.isNotBlank(wxCoupon.getBusiness())) { | if(StringUtils.isNotBlank(wxCoupon.getBusiness())) { | ||||
| String[] arys = wxCoupon.getBusiness().split(","); | String[] arys = wxCoupon.getBusiness().split(","); | ||||
| wxCoupon.setBusiness(JSON.toJSONString(arys)); | wxCoupon.setBusiness(JSON.toJSONString(arys)); | ||||
| } | } | ||||
| Long id = wxCouponService.saveOrUpdate(wxCoupon); | |||||
| return new ResultData(id); | |||||
| return wxCouponService.updateCoupon(wxCoupon); | |||||
| } | } | ||||
| @ApiOperation("根据id删除接口") | @ApiOperation("根据id删除接口") | ||||
| @@ -128,7 +169,7 @@ public class WxCouponController extends BaseController | |||||
| public ResultData sendList(@ModelAttribute WxCoupon wxCoupon,Integer pageNum, Integer pageSize) { | public ResultData sendList(@ModelAttribute WxCoupon wxCoupon,Integer pageNum, Integer pageSize) { | ||||
| if (null == wxCoupon) wxCoupon = new WxCoupon(); | if (null == wxCoupon) wxCoupon = new WxCoupon(); | ||||
| wxCoupon.setTenantId(getTenantId()); | wxCoupon.setTenantId(getTenantId()); | ||||
| wxCoupon.setStatus(1); | |||||
| wxCoupon.setStatus(0); | |||||
| PageInfo<WxCoupon> page = null; | PageInfo<WxCoupon> page = null; | ||||
| page = wxCouponService.findCanSendList(wxCoupon, pageNum, pageSize); | page = wxCouponService.findCanSendList(wxCoupon, pageNum, pageSize); | ||||
| @@ -4,6 +4,7 @@ import com.github.pagehelper.PageInfo; | |||||
| import com.simple.common.Result; | import com.simple.common.Result; | ||||
| import com.simple.common.ResultData; | import com.simple.common.ResultData; | ||||
| import com.simple.domain.po.WxCouponOrder; | import com.simple.domain.po.WxCouponOrder; | ||||
| import com.simple.domain.vo.WxCouponOrderBVo; | |||||
| import com.simple.service.WxCouponOrderService; | import com.simple.service.WxCouponOrderService; | ||||
| import io.swagger.annotations.Api; | import io.swagger.annotations.Api; | ||||
| import io.swagger.annotations.ApiImplicitParam; | import io.swagger.annotations.ApiImplicitParam; | ||||
| @@ -29,39 +30,10 @@ public class WxCouponOrderController extends BaseController | |||||
| @ApiImplicitParam(name="pageNum",value="页数",dataType="int", paramType = "query",required=true), | @ApiImplicitParam(name="pageNum",value="页数",dataType="int", paramType = "query",required=true), | ||||
| @ApiImplicitParam(name="pageSize",value="每页条数",dataType="int", paramType = "query",required=true)}) | @ApiImplicitParam(name="pageSize",value="每页条数",dataType="int", paramType = "query",required=true)}) | ||||
| public ResultData list(@ModelAttribute WxCouponOrder wxCouponOrder, Integer pageNum, Integer pageSize) { | 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); | |||||
| if (wxCouponOrder == null) wxCouponOrder= new WxCouponOrder(); | |||||
| wxCouponOrder.setTenantId(getTenantId()); | |||||
| return wxCouponOrderService.listAdminAsPage(wxCouponOrder, pageNum, pageSize); | |||||
| } | } | ||||
| @ApiOperation("新增接口") | |||||
| @PostMapping("add") | |||||
| public ResultData add(@RequestBody WxCouponOrder wxCouponOrder) { | |||||
| //Assert.notNull(wxCouponOrder.getName(), "角色名不能为空"); | |||||
| //Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名"); | |||||
| wxCouponOrderService.saveOrUpdate(wxCouponOrder); | |||||
| return new ResultData(); | |||||
| } | |||||
| @ApiOperation("根据id更新接口") | |||||
| @PostMapping("update") | |||||
| public ResultData update(@RequestBody WxCouponOrder wxCouponOrder) { | |||||
| wxCouponOrderService.saveOrUpdate(wxCouponOrder); | |||||
| return new ResultData(); | |||||
| } | |||||
| @ApiOperation("根据id删除接口") | |||||
| @GetMapping("/del") | |||||
| @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | |||||
| public ResultData delete(Long id) { | |||||
| wxCouponOrderService.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,"查询成功",wxCouponOrderService.getById(id)); | |||||
| } | |||||
| } | } | ||||
| @@ -46,21 +46,25 @@ public class WxCouponSendController extends BaseController | |||||
| @ApiOperation("新增接口") | @ApiOperation("新增接口") | ||||
| @PostMapping("add") | @PostMapping("add") | ||||
| public ResultData add(@RequestBody WxCouponSend wxCouponSend) { | public ResultData add(@RequestBody WxCouponSend wxCouponSend) { | ||||
| if (null == wxCouponSend){ | |||||
| return new ResultData(Result.ERROR,"参数不对"); | |||||
| } | |||||
| wxCouponSend.setTenantId(getTenantId()); | |||||
| wxCouponSend.setStatus(0); | |||||
| List<WxCouponSend> wxCouponSendList = wxCouponSendService.listAsPage(wxCouponSend,1,1).getList(); | List<WxCouponSend> wxCouponSendList = wxCouponSendService.listAsPage(wxCouponSend,1,1).getList(); | ||||
| if(wxCouponSendList!=null&&!wxCouponSendList.isEmpty()){ | if(wxCouponSendList!=null&&!wxCouponSendList.isEmpty()){ | ||||
| return new ResultData(Result.ERROR,"已经添加过该券"); | return new ResultData(Result.ERROR,"已经添加过该券"); | ||||
| } | } | ||||
| WxCoupon wxCoupon = wxCouponService.getById(wxCouponSend.getCouponId()); | WxCoupon wxCoupon = wxCouponService.getById(wxCouponSend.getCouponId()); | ||||
| if(wxCoupon.getSendEndDate().before(new Date())){ | |||||
| return new ResultData(Result.ERROR,"发放日期异常"); | |||||
| if(wxCoupon.getStatus()!=0||wxCoupon.getSendType()!=2){ | |||||
| return new ResultData(Result.ERROR,"该券的状态有问题"); | |||||
| } | } | ||||
| wxCouponSend.setMerchantId(wxCoupon.getMerchantId()); | wxCouponSend.setMerchantId(wxCoupon.getMerchantId()); | ||||
| wxCouponSend.setType(wxCoupon.getType()); | wxCouponSend.setType(wxCoupon.getType()); | ||||
| wxCouponSend.setTenantId(wxCoupon.getTenantId()); | wxCouponSend.setTenantId(wxCoupon.getTenantId()); | ||||
| wxCouponSend.setTitle(wxCoupon.getTitle()); | wxCouponSend.setTitle(wxCoupon.getTitle()); | ||||
| wxCouponSend.setSendStartTime(wxCoupon.getSendStartDate()); | |||||
| wxCouponSend.setSendEndTime(wxCoupon.getSendEndDate()); | |||||
| //Assert.notNull(wxCouponSend.getName(), "角色名不能为空"); | //Assert.notNull(wxCouponSend.getName(), "角色名不能为空"); | ||||
| //Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名"); | //Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名"); | ||||
| wxCouponSendService.saveOrUpdate(wxCouponSend); | wxCouponSendService.saveOrUpdate(wxCouponSend); | ||||
| @@ -72,10 +72,10 @@ public class WxLevelConfigController extends BaseController | |||||
| // } | // } | ||||
| @ApiOperation("根据id删除接口") | @ApiOperation("根据id删除接口") | ||||
| @GetMapping("/del") | |||||
| @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | |||||
| public ResultData delete(Long id) { | |||||
| wxLevelConfigService.deleteById(id); | |||||
| @PostMapping("/del") | |||||
| // @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | |||||
| public ResultData delete(@RequestBody WxLevelConfig wxLevelConfig) { | |||||
| wxLevelConfigService.deleteById(wxLevelConfig.getId()); | |||||
| return new ResultData(Result.SUCCESS, "删除成功", null); | return new ResultData(Result.SUCCESS, "删除成功", null); | ||||
| } | } | ||||
| @@ -0,0 +1,123 @@ | |||||
| package com.simple.controller; | |||||
| import org.apache.log4j.Logger; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.web.bind.annotation.GetMapping; | |||||
| import org.springframework.web.bind.annotation.PostMapping; | |||||
| import org.springframework.web.bind.annotation.RequestBody; | |||||
| import org.springframework.web.bind.annotation.RequestMapping; | |||||
| import org.springframework.web.bind.annotation.RestController; | |||||
| import com.github.pagehelper.PageInfo; | |||||
| import com.simple.common.ResultData; | |||||
| import com.simple.domain.po.WxMallConfig; | |||||
| import com.simple.service.WxMallConfigService; | |||||
| import io.swagger.annotations.Api; | |||||
| import io.swagger.annotations.ApiOperation; | |||||
| @RestController | |||||
| @RequestMapping("wxMallConfig") | |||||
| @Api(description="停车发券和核销发劵接口") | |||||
| public class WxMallConfigController extends BaseController | |||||
| { | |||||
| @Autowired | |||||
| private WxMallConfigService wxMallConfigService; | |||||
| private Logger logger = Logger.getLogger(WxMallConfigController.class); | |||||
| @ApiOperation("获取停车劵开关") | |||||
| @GetMapping("getStopCarConpon") | |||||
| public ResultData getStopCarConpon() { | |||||
| WxMallConfig wxMallConfig = new WxMallConfig(); | |||||
| wxMallConfig.setKey("stopCarCouponSwitch"); | |||||
| wxMallConfig.setTenantId(getTenantId()); | |||||
| PageInfo<WxMallConfig> page = wxMallConfigService.listAsPage(wxMallConfig, 1, 1); | |||||
| if(page.getSize()>0) { | |||||
| WxMallConfig config = page.getList().get(0); | |||||
| return new ResultData(config); | |||||
| } | |||||
| return new ResultData(); | |||||
| } | |||||
| @ApiOperation("获取核销劵开关") | |||||
| @GetMapping("getVerifyConpon") | |||||
| public ResultData getVerifyConpon() { | |||||
| WxMallConfig wxMallConfig = new WxMallConfig(); | |||||
| wxMallConfig.setKey("verifyConponSwitch"); | |||||
| wxMallConfig.setTenantId(getTenantId()); | |||||
| PageInfo<WxMallConfig> page = wxMallConfigService.listAsPage(wxMallConfig, 1, 1); | |||||
| if(page.getSize()>0) { | |||||
| WxMallConfig config = page.getList().get(0); | |||||
| return new ResultData(config); | |||||
| } | |||||
| return new ResultData(); | |||||
| } | |||||
| @PostMapping("updateStopCarConpon") | |||||
| @ApiOperation("修改停车开关") | |||||
| public ResultData updateStopCarConpon(@RequestBody WxMallConfig wxMallConfig) { | |||||
| WxMallConfig temp = new WxMallConfig(); | |||||
| // temp.setKey("stopCarCouponSwitch"); | |||||
| temp.setValue(wxMallConfig.getValue()); | |||||
| temp.setId(wxMallConfig.getId()); | |||||
| wxMallConfigService.saveOrUpdate(temp); | |||||
| return new ResultData(); | |||||
| } | |||||
| @PostMapping("updateVerifyConpon") | |||||
| @ApiOperation("修改核销开关") | |||||
| public ResultData updateVerifyConpon(@RequestBody WxMallConfig wxMallConfig) { | |||||
| WxMallConfig temp = new WxMallConfig(); | |||||
| // temp.setKey("verifyConponSwitch"); | |||||
| temp.setValue(wxMallConfig.getValue()); | |||||
| temp.setId(wxMallConfig.getId()); | |||||
| wxMallConfigService.saveOrUpdate(temp); | |||||
| return new ResultData(); | |||||
| } | |||||
| // @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 WxMallConfig wxMallConfig,Integer pageNum, Integer pageSize) { | |||||
| // if (null == wxMallConfig) wxMallConfig = new WxMallConfig(); | |||||
| // final PageInfo<WxMallConfig> page = wxMallConfigService.listAsPage(wxMallConfig, pageNum, pageSize); | |||||
| // return new ResultData(page); | |||||
| // } | |||||
| // | |||||
| // @ApiOperation("新增接口") | |||||
| // @PostMapping("add") | |||||
| // public ResultData add(@RequestBody WxMallConfig wxMallConfig) { | |||||
| // //Assert.notNull(wxMallConfig.getName(), "角色名不能为空"); | |||||
| // //Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名"); | |||||
| // wxMallConfigService.saveOrUpdate(wxMallConfig); | |||||
| // return new ResultData(); | |||||
| // } | |||||
| // | |||||
| // @ApiOperation("根据id更新接口") | |||||
| // @PostMapping("update") | |||||
| // public ResultData update(@RequestBody WxMallConfig wxMallConfig) { | |||||
| // wxMallConfigService.saveOrUpdate(wxMallConfig); | |||||
| // return new ResultData(); | |||||
| // } | |||||
| // | |||||
| // @ApiOperation("根据id删除接口") | |||||
| // @GetMapping("/del") | |||||
| // @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | |||||
| // public ResultData delete(Long id) { | |||||
| // wxMallConfigService.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,"查询成功",wxMallConfigService.getById(id)); | |||||
| // } | |||||
| } | |||||
| @@ -75,28 +75,5 @@ public class WxMerchantBUserController extends BaseController | |||||
| boolean has=wxMerchantBUserService.hasphone(phone); | boolean has=wxMerchantBUserService.hasphone(phone); | ||||
| return new ResultData(Result.SUCCESS,"查询成功",has); | return new ResultData(Result.SUCCESS,"查询成功",has); | ||||
| } | } | ||||
| @ApiOperation("修改密码") | |||||
| @PostMapping("/updatepwd") | |||||
| public ResultData updatepwd(@RequestBody Map<String,String> params) { | |||||
| // String phone,String code,String pwd | |||||
| String phone=params.get("phone"); | |||||
| String code=params.get("code"); | |||||
| String pwd=params.get("pwd"); | |||||
| boolean blank = StringUtils.isBlank(phone); | |||||
| if(blank){ | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"手机号不能为空"); | |||||
| } | |||||
| blank = StringUtils.isBlank(code); | |||||
| if(blank){ | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"验证码不能为空"); | |||||
| } | |||||
| blank = StringUtils.isBlank(pwd); | |||||
| if(blank){ | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"密码不能为空"); | |||||
| } | |||||
| return wxMerchantBUserService.updatepwd(phone,code,pwd); | |||||
| } | |||||
| } | } | ||||
| @@ -5,6 +5,7 @@ import com.simple.exception.BizMessageException; | |||||
| import com.simple.exception.MallinkException; | import com.simple.exception.MallinkException; | ||||
| import com.simple.pay.WxPayment; | import com.simple.pay.WxPayment; | ||||
| import com.simple.service.WxPayOrderService; | import com.simple.service.WxPayOrderService; | ||||
| import com.simple.service.WxProfitSharingOrderService; | |||||
| import com.simple.service.WxRefundOrderService; | import com.simple.service.WxRefundOrderService; | ||||
| import com.simple.utils.XmlUtil; | import com.simple.utils.XmlUtil; | ||||
| import org.apache.commons.io.IOUtils; | import org.apache.commons.io.IOUtils; | ||||
| @@ -31,6 +32,9 @@ public class WxPayController extends BaseController { | |||||
| @Autowired | @Autowired | ||||
| private WxRefundOrderService wxRefundOrderService; | private WxRefundOrderService wxRefundOrderService; | ||||
| @Autowired | |||||
| private WxProfitSharingOrderService wxProfitSharingOrderService; | |||||
| /** | /** | ||||
| * | * | ||||
| * @return 接收微信异步通知 | * @return 接收微信异步通知 | ||||
| @@ -117,5 +121,42 @@ public class WxPayController extends BaseController { | |||||
| return XmlUtil.getRequestXml(resultMap); | return XmlUtil.getRequestXml(resultMap); | ||||
| } | } | ||||
| } | } | ||||
| /** | |||||
| * | |||||
| * @return 接收微信分账异步通知 | |||||
| * @throws Exception 可能产生的任何异常 | |||||
| */ | |||||
| @RequestMapping(value = "/sharing") | |||||
| public String __shareNotify(HttpServletRequest request) throws Exception { | |||||
| Map<String, String> paramMap = null; | |||||
| String response; | |||||
| try { | |||||
| String xml = IOUtils.toString(request.getInputStream(), Charset.forName("UTF-8")); | |||||
| paramMap = WxPayment.xmlToMap(xml); | |||||
| logger.info("share wxpay, notify, param: " + paramMap.toString() ); | |||||
| response = wxPayOrderService.notify(paramMap, EnumPayWay.PAY_WAY_WEAPP); | |||||
| logger.info("share wxpay, notify success, req : " + paramMap.toString() + ", resp: " + response.toString()); | |||||
| return response; | |||||
| } catch (BizMessageException e) { | |||||
| logger.error("share wxpay, notify error, req: " + paramMap.toString() + ", e:" + e.getLocalizedMessage()); | |||||
| SortedMap resultMap = new TreeMap(); | |||||
| resultMap.put("return_code", "FAIL"); | |||||
| resultMap.put("return_msg", e.getMessage()); | |||||
| return XmlUtil.getRequestXml(resultMap); | |||||
| } catch (MallinkException e) { | |||||
| logger.error("refund wxpay, notify error, req: " + paramMap.toString() + ", e:" +e.getLocalizedMessage()); | |||||
| SortedMap resultMap = new TreeMap(); | |||||
| resultMap.put("return_code", "FAIL"); | |||||
| resultMap.put("return_msg", e.getMessage()); | |||||
| return XmlUtil.getRequestXml(resultMap); | |||||
| } catch (Exception e) { | |||||
| logger.error("refund wxpay, order create error, req: " + paramMap.toString() + ", e: " + e.getMessage()); | |||||
| SortedMap resultMap = new TreeMap(); | |||||
| resultMap.put("return_code", "FAIL"); | |||||
| resultMap.put("return_msg", e.getMessage()); | |||||
| return XmlUtil.getRequestXml(resultMap); | |||||
| } | |||||
| } | |||||
| } | } | ||||
| @@ -31,6 +31,7 @@ public class WxShopController extends BaseController | |||||
| @ApiImplicitParam(name="pageSize",value="每页条数",dataType="int", paramType = "query",required=true)}) | @ApiImplicitParam(name="pageSize",value="每页条数",dataType="int", paramType = "query",required=true)}) | ||||
| public ResultData list(@ModelAttribute WxShop wxShop,Integer pageNum, Integer pageSize) { | public ResultData list(@ModelAttribute WxShop wxShop,Integer pageNum, Integer pageSize) { | ||||
| if (null == wxShop) wxShop = new WxShop(); | if (null == wxShop) wxShop = new WxShop(); | ||||
| wxShop.setTenantId(getTenantId()); | |||||
| final PageInfo<Map<String,Object>> page = wxShopService.listMapAsPage(wxShop, pageNum, pageSize); | final PageInfo<Map<String,Object>> page = wxShopService.listMapAsPage(wxShop, pageNum, pageSize); | ||||
| return new ResultData(page); | return new ResultData(page); | ||||
| } | } | ||||
| @@ -1,7 +1,9 @@ | |||||
| package com.simple.controller; | package com.simple.controller; | ||||
| import java.text.SimpleDateFormat; | |||||
| import java.util.ArrayList; | import java.util.ArrayList; | ||||
| import java.util.Calendar; | import java.util.Calendar; | ||||
| import java.util.Date; | |||||
| import java.util.List; | import java.util.List; | ||||
| import org.apache.log4j.Logger; | import org.apache.log4j.Logger; | ||||
| @@ -32,43 +34,45 @@ public class WxDateAmountRecordController extends BaseController | |||||
| private WxDateAmountRecordService wxDateAmountRecordService; | private WxDateAmountRecordService wxDateAmountRecordService; | ||||
| private Logger logger = Logger.getLogger(WxDateAmountRecordController.class); | private Logger logger = Logger.getLogger(WxDateAmountRecordController.class); | ||||
| @ApiOperation("首页查询交易金额记录和核销记录接口") | |||||
| @GetMapping("list") | |||||
| public ResultData getRecord() { | |||||
| Calendar c =Calendar.getInstance(); | |||||
| int weekOfYear =c.get(Calendar.WEEK_OF_YEAR); | |||||
| int day =c.get(Calendar.DAY_OF_WEEK); | |||||
| WxDateAmountRecord temp = new WxDateAmountRecord(); | |||||
| temp.setWeekOfYear(weekOfYear); | |||||
| WxMerchantBUser u = getUser(); | |||||
| temp.setTenantId(u.getTenantId()); | |||||
| temp.setMerchantId(u.getMerchantId()); | |||||
| AmountRecordVo vo = new AmountRecordVo(); | |||||
| vo.setOrderAmountList(getAmountRecord(temp, day,0,vo)); | |||||
| vo.setVerifyAmountList(getAmountRecord(temp,day, 1,vo)); | |||||
| return new ResultData(Result.SUCCESS,"ok",vo); | |||||
| } | |||||
| private List<WxDateAmountRecord> getAmountRecord( WxDateAmountRecord temp,int day ,int type,AmountRecordVo vo){ | |||||
| temp.setType(type); | |||||
| List<WxDateAmountRecord> list =new ArrayList<>(); | |||||
| for(int i=1;i<=7;i++) {//周日是1 | |||||
| temp.setDayOfWeek(i); | |||||
| PageInfo<WxDateAmountRecord> page = wxDateAmountRecordService.listAsPage(temp, 1, 1); | |||||
| if(page.getSize()>0) { | |||||
| if(i==day ) { | |||||
| if(type==0) { | |||||
| vo.setOrderAmount(page.getList().get(0).getPayPrice()); | |||||
| }else { | |||||
| vo.setVerifyAmount(page.getList().get(0).getPayPrice()); | |||||
| } | |||||
| } | |||||
| list.add(page.getList().get(0)); | |||||
| } | |||||
| } | |||||
| return list; | |||||
| @ApiOperation("首页查询交易金额记录接口") | |||||
| @GetMapping("listOrder") | |||||
| public ResultData listOrder() { | |||||
| return list(0); | |||||
| } | } | ||||
| @ApiOperation("首页查询核销金额记录接口") | |||||
| @GetMapping("listVerified") | |||||
| public ResultData listVerified() { | |||||
| return list(1); | |||||
| } | |||||
| private ResultData list(int verified) { | |||||
| List<AmountRecordVo> list =new ArrayList<>(); | |||||
| WxDateAmountRecord temp = new WxDateAmountRecord(); | |||||
| WxMerchantBUser u = getUser(); | |||||
| temp.setTenantId(u.getTenantId()); | |||||
| temp.setMerchantId(u.getMerchantId()); | |||||
| temp.setType(verified); | |||||
| temp.setSortColumns(WxDateAmountRecord.Field.UpdateDate_ASC); | |||||
| SimpleDateFormat fmt = new SimpleDateFormat("MM/dd"); | |||||
| PageInfo<WxDateAmountRecord> page = wxDateAmountRecordService.listAsPage(temp, 1, 7); | |||||
| if(page.getSize()>0) { | |||||
| for (WxDateAmountRecord wxDateAmountRecord:page.getList()) { | |||||
| AmountRecordVo vo = new AmountRecordVo(); | |||||
| vo.setAmount(wxDateAmountRecord.getPayPrice()); | |||||
| vo.setAmountDetail(wxDateAmountRecord); | |||||
| vo.setMouthAndDate(fmt.format(wxDateAmountRecord.getUpdateDate())); | |||||
| list.add(vo); | |||||
| } | |||||
| } | |||||
| return new ResultData(list); | |||||
| } | |||||
| } | } | ||||
| @@ -165,28 +165,30 @@ public class WxMerchantBUserController extends BaseController | |||||
| } | } | ||||
| @AuthIgnore | @AuthIgnore | ||||
| @ApiOperation("修改密码") | |||||
| @ApiOperation(value = "修改密码", notes = "{\"appId\",\"string\", \"phone\",\"string\",\"code\",\"string\",\"pwd\",\"string\"}") | |||||
| @PostMapping("/updatepwd") | @PostMapping("/updatepwd") | ||||
| public ResultData updatepwd(@RequestBody Map<String,String> params) { | public ResultData updatepwd(@RequestBody Map<String,String> params) { | ||||
| // String phone,String code,String pwd | // String phone,String code,String pwd | ||||
| String appId = params.get("appId"); | |||||
| String phone=params.get("phone"); | String phone=params.get("phone"); | ||||
| String code=params.get("code"); | String code=params.get("code"); | ||||
| String pwd=params.get("pwd"); | String pwd=params.get("pwd"); | ||||
| boolean blank = StringUtils.isBlank(phone); | |||||
| if(blank){ | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"手机号不能为空"); | |||||
| if (StringUtils.isBlank(appId)) { | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "appId不能为空"); | |||||
| } | } | ||||
| blank = StringUtils.isBlank(code); | |||||
| if(blank){ | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"验证码不能为空"); | |||||
| if (StringUtils.isBlank(phone)) { | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "手机号不能为空"); | |||||
| } | } | ||||
| blank = StringUtils.isBlank(pwd); | |||||
| if(blank){ | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"密码不能为空"); | |||||
| if (StringUtils.isBlank(code)) { | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "验证码不能为空"); | |||||
| } | |||||
| if (StringUtils.isBlank(pwd)) { | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "密码不能为空"); | |||||
| } | } | ||||
| return wxMerchantBUserService.updatepwd(phone,code,pwd); | |||||
| return wxMerchantBUserService.updatepwd(appId, phone, code, pwd); | |||||
| } | } | ||||
| } | } | ||||
| @@ -36,18 +36,17 @@ public class WxMsgValidationcodeController extends BaseController { | |||||
| @GetMapping("sendvalidationcode") | @GetMapping("sendvalidationcode") | ||||
| @ApiImplicitParams({ | @ApiImplicitParams({ | ||||
| @ApiImplicitParam(name = "tenantId", value = "租户ID", dataType = "String", paramType = "query"), | |||||
| @ApiImplicitParam(name = "phone", value = "手机号", dataType = "String", paramType = "query", required = true), | @ApiImplicitParam(name = "phone", value = "手机号", dataType = "String", paramType = "query", required = true), | ||||
| @ApiImplicitParam(name = "type", value = "场景", dataType = "Integer", 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)}) | @ApiImplicitParam(name = "appid", value = "appid", dataType = "String", paramType = "query", required = true)}) | ||||
| public ResultData sendvalidationcode(String tenantId, String phone, Integer type, String appid) { | |||||
| public ResultData sendvalidationcode(String phone, Integer type, String appid) { | |||||
| WxMerchantBUser user = new WxMerchantBUser(); | |||||
| user.setAppId(appid); | |||||
| user.setPhone(phone); | |||||
| WxMerchantBUser userQ = new WxMerchantBUser(); | |||||
| userQ.setAppId(appid); | |||||
| userQ.setPhone(phone); | |||||
| WxMerchantBUser buser=wxMerchantBUserService.getBUserByAppId(user); | |||||
| if (buser==null) { | |||||
| WxMerchantBUser user=wxMerchantBUserService.getBUserByAppId(userQ); | |||||
| if (user==null) { | |||||
| logger.error("B端用户不存在, phone: " + phone); | logger.error("B端用户不存在, phone: " + phone); | ||||
| return new ResultData(ErrorCode.USER_IS_EMPTY); | return new ResultData(ErrorCode.USER_IS_EMPTY); | ||||
| } | } | ||||
| @@ -65,7 +64,7 @@ public class WxMsgValidationcodeController extends BaseController { | |||||
| } | } | ||||
| WxMsgValidationcode wxMsgValidationcode = new WxMsgValidationcode(); | WxMsgValidationcode wxMsgValidationcode = new WxMsgValidationcode(); | ||||
| wxMsgValidationcode.setTenantId(tenantId); | |||||
| wxMsgValidationcode.setTenantId(user.getTenantId()); | |||||
| wxMsgValidationcode.setPhone(phone); | wxMsgValidationcode.setPhone(phone); | ||||
| wxMsgValidationcode.setType(type); | wxMsgValidationcode.setType(type); | ||||
| wxMsgValidationcode.setAppid(appid); | wxMsgValidationcode.setAppid(appid); | ||||
| @@ -1,117 +0,0 @@ | |||||
| package com.simple.controller; | |||||
| import com.simple.common.ErrorCode; | |||||
| import com.simple.domain.po.WxMerchantBUser; | |||||
| import com.simple.domain.vo.OrderVo; | |||||
| import com.simple.enums.EnumOrderStatus; | |||||
| import io.swagger.annotations.Api; | |||||
| import io.swagger.models.auth.In; | |||||
| 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.*; | |||||
| import com.github.pagehelper.PageInfo; | |||||
| import com.simple.common.Result; | |||||
| import com.simple.common.ResultData; | |||||
| import com.simple.domain.po.WxOrder; | |||||
| import com.simple.service.WxOrderService; | |||||
| import io.swagger.annotations.ApiImplicitParam; | |||||
| import io.swagger.annotations.ApiImplicitParams; | |||||
| import io.swagger.annotations.ApiOperation; | |||||
| import java.util.Map; | |||||
| @RestController | |||||
| @RequestMapping("/order") | |||||
| @Api(description="订单相关接口") | |||||
| public class WxOrderController extends BaseController { | |||||
| private Logger logger = Logger.getLogger(WxOrderController.class); | |||||
| @Autowired | |||||
| private WxOrderService wxOrderService; | |||||
| @GetMapping("list") | |||||
| @ApiOperation(value = "券查询接口", notes="") | |||||
| @ApiImplicitParams({ | |||||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true), | |||||
| @ApiImplicitParam(name = "orderStatus", value = "订单状态:-1全部;0-已下单/待付款;1-已支付;2-已取消(限定时间内未付款);3-未退款/待退款;4-已退款;5-退款失败", required = false, dataType = "Integer"), | |||||
| @ApiImplicitParam(name = "couponStatus", value = "券状态:-1全部;3:已领取/已购买/未核销/未使用,4:已核销/已使用,5:已过期,6:已退券", required = false, dataType = "Integer") | |||||
| }) | |||||
| public ResultData list(Integer orderStatus, Integer couponStatus, Integer pageNum, Integer pageSize) { | |||||
| WxMerchantBUser user = getUser(); | |||||
| OrderVo orderVo = new OrderVo(); | |||||
| orderVo.setbUserId(user.getId()); | |||||
| if (orderStatus != -1) | |||||
| orderVo.setOrderStatus(orderStatus); | |||||
| if (couponStatus != -1) | |||||
| orderVo.setCouponStatus(couponStatus); | |||||
| final PageInfo<Map<String,Object>> page = wxOrderService.bQueryListMap(orderVo, pageNum, pageSize); | |||||
| return new ResultData(page); | |||||
| } | |||||
| @ApiOperation(value = "订单详情", notes = "{\"couponOrderId\":\"String\",\"orderId\":\"String\",\"couponId\":\"String\"}") | |||||
| @GetMapping("detail") | |||||
| public ResultData orderDetail(@RequestBody Map<String, String> paramMap) { | |||||
| //Assert.notNull(wxOrders.getName(), "角色名不能为空"); | |||||
| //Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名"); | |||||
| String couponOrderIdStr = paramMap.get("couponOrderId"); | |||||
| String orderIdStr = paramMap.get("orderId"); | |||||
| String couponIdStr = paramMap.get("couponId"); | |||||
| if (StringUtils.isBlank(couponOrderIdStr)) { | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "couponOrderId不能为空"); | |||||
| } | |||||
| if (StringUtils.isBlank(orderIdStr)) { | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "orderId不能为空"); | |||||
| } | |||||
| if (StringUtils.isBlank(couponIdStr)) { | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "couponId不能为空"); | |||||
| } | |||||
| Long couponOrderId = 0L, orderId = 0L, couponId = 0L; | |||||
| try { | |||||
| couponOrderId = Long.valueOf(couponOrderIdStr); | |||||
| orderId = Long.valueOf(orderIdStr); | |||||
| couponId = Long.valueOf(couponIdStr); | |||||
| } catch (NumberFormatException e) { | |||||
| logger.error("couponOrderId " + couponOrderIdStr + ", e:" + e.getMessage()); | |||||
| } | |||||
| WxMerchantBUser user = getUser(); | |||||
| OrderVo orderVo = new OrderVo(); | |||||
| orderVo.setbUserId(user.getId()); | |||||
| orderVo.setOrderId(orderId); | |||||
| orderVo.setCouponId(couponId); | |||||
| Map<String,Object> map = wxOrderService.queryObject(orderVo); | |||||
| return new ResultData(map); | |||||
| } | |||||
| @ApiOperation(value = "手工退款", notes = "{\"orderId\":\"string\"}") | |||||
| @PostMapping("refund") | |||||
| public ResultData expiringOrder(@RequestBody Map<String, String> paramMap) { | |||||
| //Assert.notNull(wxOrders.getName(), "角色名不能为空"); | |||||
| //Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名"); | |||||
| String orderIdStr = paramMap.get("orderId"); | |||||
| if (StringUtils.isBlank(orderIdStr)) { | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "orderId不能为空"); | |||||
| } | |||||
| Long orderId = 0L; | |||||
| try { | |||||
| orderId = Long.valueOf(orderIdStr); | |||||
| } catch (NumberFormatException e) { | |||||
| logger.error("orderId " + orderIdStr + ", e:" + e.getMessage()); | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "订单ID转换异常"); | |||||
| } | |||||
| try { | |||||
| WxOrder order = wxOrderService.getById(orderId); | |||||
| if (order != null) { | |||||
| wxOrderService.updateOrderStatus(order, EnumOrderStatus.ORDER_STATUS_PENDING_REFUND); | |||||
| } | |||||
| } catch (Exception e) { | |||||
| logger.error("orderId " + orderIdStr + ", e:" + e.getMessage()); | |||||
| } | |||||
| return new ResultData(); | |||||
| } | |||||
| } | |||||
| @@ -5,6 +5,7 @@ import com.simple.common.ResultData; | |||||
| import com.simple.domain.po.WxBusiness; | import com.simple.domain.po.WxBusiness; | ||||
| import com.simple.domain.po.WxCUser; | import com.simple.domain.po.WxCUser; | ||||
| import com.simple.service.WxBusinessService; | import com.simple.service.WxBusinessService; | ||||
| import io.swagger.annotations.Api; | |||||
| import io.swagger.annotations.ApiImplicitParam; | import io.swagger.annotations.ApiImplicitParam; | ||||
| import io.swagger.annotations.ApiImplicitParams; | import io.swagger.annotations.ApiImplicitParams; | ||||
| import io.swagger.annotations.ApiOperation; | import io.swagger.annotations.ApiOperation; | ||||
| @@ -16,6 +17,7 @@ import org.springframework.web.bind.annotation.RestController; | |||||
| @RestController | @RestController | ||||
| @RequestMapping("/api/wxBusiness") | @RequestMapping("/api/wxBusiness") | ||||
| @Api(description = "业态查询接口") | |||||
| public class WxBusinessController extends BaseController { | public class WxBusinessController extends BaseController { | ||||
| private Logger logger = Logger.getLogger(WxBusinessController.class); | private Logger logger = Logger.getLogger(WxBusinessController.class); | ||||
| @@ -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.WxCLog; | |||||
| import com.simple.service.WxCLogService; | |||||
| import io.swagger.annotations.ApiImplicitParam; | |||||
| import io.swagger.annotations.ApiImplicitParams; | |||||
| import io.swagger.annotations.ApiOperation; | |||||
| @RestController | |||||
| @RequestMapping("wxCLog") | |||||
| public class WxCLogController extends BaseController | |||||
| { | |||||
| @Autowired | |||||
| private WxCLogService wxCLogService; | |||||
| private Logger logger = Logger.getLogger(WxCLogController.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 WxCLog wxCLog,Integer pageNum, Integer pageSize) { | |||||
| if (null == wxCLog) wxCLog = new WxCLog(); | |||||
| final PageInfo<WxCLog> page = wxCLogService.listAsPage(wxCLog, pageNum, pageSize); | |||||
| return new ResultData(page); | |||||
| } | |||||
| @ApiOperation("新增接口") | |||||
| @PostMapping("add") | |||||
| public ResultData add(@RequestBody WxCLog wxCLog) { | |||||
| //Assert.notNull(wxCLog.getName(), "角色名不能为空"); | |||||
| //Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名"); | |||||
| wxCLogService.saveOrUpdate(wxCLog); | |||||
| return new ResultData(); | |||||
| } | |||||
| @ApiOperation("根据id更新接口") | |||||
| @PostMapping("update") | |||||
| public ResultData update(@RequestBody WxCLog wxCLog) { | |||||
| wxCLogService.saveOrUpdate(wxCLog); | |||||
| return new ResultData(); | |||||
| } | |||||
| @ApiOperation("根据id删除接口") | |||||
| @GetMapping("/del") | |||||
| @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | |||||
| public ResultData delete(Long id) { | |||||
| wxCLogService.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,"查询成功",wxCLogService.getById(id)); | |||||
| } | |||||
| } | |||||
| @@ -40,10 +40,9 @@ public class WxCampaignController extends BaseController | |||||
| @ApiImplicitParam(name="pageNum",value="页数",dataType="int", paramType = "query",required=true), | @ApiImplicitParam(name="pageNum",value="页数",dataType="int", paramType = "query",required=true), | ||||
| @ApiImplicitParam(name="pageSize",value="每页条数",dataType="int", paramType = "query",required=true)}) | @ApiImplicitParam(name="pageSize",value="每页条数",dataType="int", paramType = "query",required=true)}) | ||||
| public ResultData list(@ModelAttribute WxCampaign wxCampaign, Integer pageNum, Integer pageSize) { | public ResultData list(@ModelAttribute WxCampaign wxCampaign, Integer pageNum, Integer pageSize) { | ||||
| if (null == wxCampaign) wxCampaign = new WxCampaign(); | |||||
| if(wxCampaign.getStatus()!=null&&wxCampaign.getStatus()==-1){ | |||||
| wxCampaign.setStatus(null); | |||||
| } | |||||
| if (null == wxCampaign) wxCampaign = new WxCampaign(); | |||||
| wxCampaign.setStatus(0); | |||||
| wxCampaign.setTenantId(getTenantId()); | wxCampaign.setTenantId(getTenantId()); | ||||
| wxCampaign.setSortColumns(SortNum_ASC); | wxCampaign.setSortColumns(SortNum_ASC); | ||||
| final PageInfo<WxCampaign> page = wxCampaignService.listAsPage(wxCampaign, pageNum, pageSize); | final PageInfo<WxCampaign> page = wxCampaignService.listAsPage(wxCampaign, pageNum, pageSize); | ||||
| @@ -15,6 +15,7 @@ import com.simple.service.WxMerchantService; | |||||
| import com.simple.service.WxParkService; | import com.simple.service.WxParkService; | ||||
| import com.simple.utils.ETCPUtil; | import com.simple.utils.ETCPUtil; | ||||
| import com.simple.utils.TJDCarUtil; | import com.simple.utils.TJDCarUtil; | ||||
| import io.swagger.annotations.Api; | |||||
| import io.swagger.annotations.ApiImplicitParam; | import io.swagger.annotations.ApiImplicitParam; | ||||
| import io.swagger.annotations.ApiImplicitParams; | import io.swagger.annotations.ApiImplicitParams; | ||||
| import io.swagger.annotations.ApiOperation; | import io.swagger.annotations.ApiOperation; | ||||
| @@ -30,6 +31,7 @@ import java.util.Map; | |||||
| @RestController | @RestController | ||||
| @RequestMapping("/api/car") | @RequestMapping("/api/car") | ||||
| @Api(description = "智慧停车相关接口") | |||||
| public class WxCarController extends BaseController | public class WxCarController extends BaseController | ||||
| { | { | ||||
| private Logger logger = Logger.getLogger(WxCarController.class); | private Logger logger = Logger.getLogger(WxCarController.class); | ||||
| @@ -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.WxCouponActionLog; | |||||
| import com.simple.service.WxCouponActionLogService; | |||||
| import io.swagger.annotations.ApiImplicitParam; | |||||
| import io.swagger.annotations.ApiImplicitParams; | |||||
| import io.swagger.annotations.ApiOperation; | |||||
| @RestController | |||||
| @RequestMapping("wxCouponActionLog") | |||||
| public class WxCouponActionLogController extends BaseController | |||||
| { | |||||
| @Autowired | |||||
| private WxCouponActionLogService wxCouponActionLogService; | |||||
| private Logger logger = Logger.getLogger(WxCouponActionLogController.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 WxCouponActionLog wxCouponActionLog,Integer pageNum, Integer pageSize) { | |||||
| if (null == wxCouponActionLog) wxCouponActionLog = new WxCouponActionLog(); | |||||
| final PageInfo<WxCouponActionLog> page = wxCouponActionLogService.listAsPage(wxCouponActionLog, pageNum, pageSize); | |||||
| return new ResultData(page); | |||||
| } | |||||
| @ApiOperation("新增接口") | |||||
| @PostMapping("add") | |||||
| public ResultData add(@RequestBody WxCouponActionLog wxCouponActionLog) { | |||||
| //Assert.notNull(wxCouponActionLog.getName(), "角色名不能为空"); | |||||
| //Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名"); | |||||
| wxCouponActionLogService.saveOrUpdate(wxCouponActionLog); | |||||
| return new ResultData(); | |||||
| } | |||||
| @ApiOperation("根据id更新接口") | |||||
| @PostMapping("update") | |||||
| public ResultData update(@RequestBody WxCouponActionLog wxCouponActionLog) { | |||||
| wxCouponActionLogService.saveOrUpdate(wxCouponActionLog); | |||||
| return new ResultData(); | |||||
| } | |||||
| @ApiOperation("根据id删除接口") | |||||
| @GetMapping("/del") | |||||
| @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | |||||
| public ResultData delete(Long id) { | |||||
| wxCouponActionLogService.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,"查询成功",wxCouponActionLogService.getById(id)); | |||||
| } | |||||
| } | |||||
| @@ -1,5 +1,6 @@ | |||||
| package com.simple.controller; | package com.simple.controller; | ||||
| import io.swagger.annotations.Api; | |||||
| import org.apache.log4j.Logger; | import org.apache.log4j.Logger; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.util.Assert; | import org.springframework.util.Assert; | ||||
| @@ -17,6 +18,7 @@ import io.swagger.annotations.ApiOperation; | |||||
| @RestController | @RestController | ||||
| @RequestMapping("wxCouponCar") | @RequestMapping("wxCouponCar") | ||||
| @Api(description = "停车发券相关接口") | |||||
| public class WxCouponCarController extends BaseController | public class WxCouponCarController extends BaseController | ||||
| { | { | ||||
| @Autowired | @Autowired | ||||
| @@ -1,6 +1,7 @@ | |||||
| package com.simple.controller; | package com.simple.controller; | ||||
| import com.simple.domain.vo.WxCouponChannelVo; | import com.simple.domain.vo.WxCouponChannelVo; | ||||
| import io.swagger.annotations.Api; | |||||
| import org.apache.log4j.Logger; | import org.apache.log4j.Logger; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.util.Assert; | import org.springframework.util.Assert; | ||||
| @@ -18,6 +19,7 @@ import io.swagger.annotations.ApiOperation; | |||||
| @RestController | @RestController | ||||
| @RequestMapping("/api/wxCouponChannel") | @RequestMapping("/api/wxCouponChannel") | ||||
| @Api(description = "发券渠道相关接口") | |||||
| public class WxCouponChannelController extends BaseController | public class WxCouponChannelController extends BaseController | ||||
| { | { | ||||
| private Logger logger = Logger.getLogger(WxCouponChannelController.class); | private Logger logger = Logger.getLogger(WxCouponChannelController.class); | ||||
| @@ -35,6 +37,7 @@ public class WxCouponChannelController extends BaseController | |||||
| public ResultData list(@ModelAttribute WxCouponChannel wxCouponChannel,Integer pageNum, Integer pageSize) { | public ResultData list(@ModelAttribute WxCouponChannel wxCouponChannel,Integer pageNum, Integer pageSize) { | ||||
| if (null == wxCouponChannel) wxCouponChannel = new WxCouponChannel(); | if (null == wxCouponChannel) wxCouponChannel = new WxCouponChannel(); | ||||
| wxCouponChannel.setTenantId(getTenantId()); | wxCouponChannel.setTenantId(getTenantId()); | ||||
| wxCouponChannel.setStatus(0); | |||||
| final PageInfo<WxCouponChannelVo> page = wxCouponChannelService.listPageCAPI(wxCouponChannel, pageNum, pageSize); | final PageInfo<WxCouponChannelVo> page = wxCouponChannelService.listPageCAPI(wxCouponChannel, pageNum, pageSize); | ||||
| return new ResultData(page); | return new ResultData(page); | ||||
| } | } | ||||
| @@ -1,7 +1,9 @@ | |||||
| package com.simple.controller; | package com.simple.controller; | ||||
| import com.simple.common.ErrorCode; | import com.simple.common.ErrorCode; | ||||
| import com.simple.domain.po.WxCouponChannel; | |||||
| import com.simple.domain.vo.WxCouponCVo; | import com.simple.domain.vo.WxCouponCVo; | ||||
| import io.swagger.annotations.Api; | |||||
| import org.apache.log4j.Logger; | import org.apache.log4j.Logger; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.util.Assert; | import org.springframework.util.Assert; | ||||
| @@ -19,43 +21,23 @@ import io.swagger.annotations.ApiOperation; | |||||
| @RestController | @RestController | ||||
| @RequestMapping("/api/wxCoupon") | @RequestMapping("/api/wxCoupon") | ||||
| @Api(description = "券类型相关接口") | |||||
| public class WxCouponController extends BaseController { | public class WxCouponController extends BaseController { | ||||
| private Logger logger = Logger.getLogger(WxCouponController.class); | private Logger logger = Logger.getLogger(WxCouponController.class); | ||||
| @Autowired | @Autowired | ||||
| private WxCouponService wxCouponService; | private WxCouponService wxCouponService; | ||||
| @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 WxCoupon wxCoupon, Integer pageNum, Integer pageSize) { | |||||
| if (null == wxCoupon) wxCoupon = new WxCoupon(); | |||||
| wxCoupon.setTenantId(getTenantId()); | |||||
| return new ResultData(wxCouponService.findListForCUser(wxCoupon, pageNum, pageSize)); | |||||
| } | |||||
| @ApiOperation("根据id查询接口") | @ApiOperation("根据id查询接口") | ||||
| @GetMapping("/detail") | @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); | |||||
| public ResultData detail(@ModelAttribute WxCouponChannel wxCouponChannel) { | |||||
| if(wxCouponChannel == null) wxCouponChannel = new WxCouponChannel(); | |||||
| wxCouponChannel.setTenantId(getTenantId()); | |||||
| WxCouponCVo wxCouponCVo = wxCouponService.selectDetailForCUser(wxCouponChannel); | |||||
| if (wxCouponCVo == null) | if (wxCouponCVo == null) | ||||
| return new ResultData(ErrorCode.COUPON_IS_EMPTY); | return new ResultData(ErrorCode.COUPON_IS_EMPTY); | ||||
| return new ResultData(wxCouponCVo); | return new ResultData(wxCouponCVo); | ||||
| } | } | ||||
| @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, "查询成功", wxCouponService.getById(id)); | |||||
| } | |||||
| } | } | ||||
| @@ -1,49 +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.WxCouponSend; | |||||
| import com.simple.service.WxCouponSendService; | |||||
| import io.swagger.annotations.ApiImplicitParam; | |||||
| import io.swagger.annotations.ApiImplicitParams; | |||||
| import io.swagger.annotations.ApiOperation; | |||||
| @RestController | |||||
| @RequestMapping("wxCouponSend") | |||||
| public class WxCouponSendController extends BaseController | |||||
| { | |||||
| @Autowired | |||||
| private WxCouponSendService wxCouponSendService; | |||||
| private Logger logger = Logger.getLogger(WxCouponSendController.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 WxCouponSend wxCouponSend,Integer pageNum, Integer pageSize) { | |||||
| if (null == wxCouponSend) wxCouponSend = new WxCouponSend(); | |||||
| wxCouponSend.setTenantId(getTenantId()); | |||||
| final PageInfo<WxCouponSend> page = wxCouponSendService.listAsPage(wxCouponSend, 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) { | |||||
| return new ResultData(Result.SUCCESS,"查询成功",wxCouponSendService.getById(id)); | |||||
| } | |||||
| } | |||||
| @@ -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.WxCouponType; | |||||
| import com.simple.service.WxCouponTypeService; | |||||
| import io.swagger.annotations.ApiImplicitParam; | |||||
| import io.swagger.annotations.ApiImplicitParams; | |||||
| import io.swagger.annotations.ApiOperation; | |||||
| @RestController | |||||
| @RequestMapping("wxCouponType") | |||||
| public class WxCouponTypeController extends BaseController | |||||
| { | |||||
| @Autowired | |||||
| private WxCouponTypeService wxCouponTypeService; | |||||
| private Logger logger = Logger.getLogger(WxCouponTypeController.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 WxCouponType wxCouponType,Integer pageNum, Integer pageSize) { | |||||
| if (null == wxCouponType) wxCouponType = new WxCouponType(); | |||||
| final PageInfo<WxCouponType> page = wxCouponTypeService.listAsPage(wxCouponType, pageNum, pageSize); | |||||
| return new ResultData(page); | |||||
| } | |||||
| @ApiOperation("新增接口") | |||||
| @PostMapping("add") | |||||
| public ResultData add(@RequestBody WxCouponType wxCouponType) { | |||||
| //Assert.notNull(wxCouponType.getName(), "角色名不能为空"); | |||||
| //Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名"); | |||||
| wxCouponTypeService.saveOrUpdate(wxCouponType); | |||||
| return new ResultData(); | |||||
| } | |||||
| @ApiOperation("根据id更新接口") | |||||
| @PostMapping("update") | |||||
| public ResultData update(@RequestBody WxCouponType wxCouponType) { | |||||
| wxCouponTypeService.saveOrUpdate(wxCouponType); | |||||
| return new ResultData(); | |||||
| } | |||||
| @ApiOperation("根据id删除接口") | |||||
| @GetMapping("/del") | |||||
| @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | |||||
| public ResultData delete(Long id) { | |||||
| wxCouponTypeService.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,"查询成功",wxCouponTypeService.getById(id)); | |||||
| } | |||||
| } | |||||
| @@ -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.WxMallBuilding; | |||||
| import com.simple.service.WxMallBuildingService; | |||||
| import io.swagger.annotations.ApiImplicitParam; | |||||
| import io.swagger.annotations.ApiImplicitParams; | |||||
| import io.swagger.annotations.ApiOperation; | |||||
| @RestController | |||||
| @RequestMapping("wxMallBuilding") | |||||
| public class WxMallBuildingController extends BaseController | |||||
| { | |||||
| @Autowired | |||||
| private WxMallBuildingService wxMallBuildingService; | |||||
| private Logger logger = Logger.getLogger(WxMallBuildingController.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 WxMallBuilding wxMallBuilding,Integer pageNum, Integer pageSize) { | |||||
| if (null == wxMallBuilding) wxMallBuilding = new WxMallBuilding(); | |||||
| final PageInfo<WxMallBuilding> page = wxMallBuildingService.listAsPage(wxMallBuilding, pageNum, pageSize); | |||||
| return new ResultData(page); | |||||
| } | |||||
| @ApiOperation("新增接口") | |||||
| @PostMapping("add") | |||||
| public ResultData add(@RequestBody WxMallBuilding wxMallBuilding) { | |||||
| //Assert.notNull(wxMallBuilding.getName(), "角色名不能为空"); | |||||
| //Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名"); | |||||
| wxMallBuildingService.saveOrUpdate(wxMallBuilding); | |||||
| return new ResultData(); | |||||
| } | |||||
| @ApiOperation("根据id更新接口") | |||||
| @PostMapping("update") | |||||
| public ResultData update(@RequestBody WxMallBuilding wxMallBuilding) { | |||||
| wxMallBuildingService.saveOrUpdate(wxMallBuilding); | |||||
| return new ResultData(); | |||||
| } | |||||
| @ApiOperation("根据id删除接口") | |||||
| @GetMapping("/del") | |||||
| @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | |||||
| public ResultData delete(Long id) { | |||||
| wxMallBuildingService.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,"查询成功",wxMallBuildingService.getById(id)); | |||||
| } | |||||
| } | |||||
| @@ -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.WxMall; | |||||
| import com.simple.service.WxMallService; | |||||
| import io.swagger.annotations.ApiImplicitParam; | |||||
| import io.swagger.annotations.ApiImplicitParams; | |||||
| import io.swagger.annotations.ApiOperation; | |||||
| @RestController | |||||
| @RequestMapping("wxMall") | |||||
| public class WxMallController extends BaseController | |||||
| { | |||||
| @Autowired | |||||
| private WxMallService wxMallService; | |||||
| private Logger logger = Logger.getLogger(WxMallController.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 WxMall wxMall,Integer pageNum, Integer pageSize) { | |||||
| if (null == wxMall) wxMall = new WxMall(); | |||||
| final PageInfo<WxMall> page = wxMallService.listAsPage(wxMall, pageNum, pageSize); | |||||
| return new ResultData(page); | |||||
| } | |||||
| @ApiOperation("新增接口") | |||||
| @PostMapping("add") | |||||
| public ResultData add(@RequestBody WxMall wxMall) { | |||||
| //Assert.notNull(wxMall.getName(), "角色名不能为空"); | |||||
| //Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名"); | |||||
| wxMallService.saveOrUpdate(wxMall); | |||||
| return new ResultData(); | |||||
| } | |||||
| @ApiOperation("根据id更新接口") | |||||
| @PostMapping("update") | |||||
| public ResultData update(@RequestBody WxMall wxMall) { | |||||
| wxMallService.saveOrUpdate(wxMall); | |||||
| return new ResultData(); | |||||
| } | |||||
| @ApiOperation("根据id删除接口") | |||||
| @GetMapping("/del") | |||||
| @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | |||||
| public ResultData delete(Long id) { | |||||
| wxMallService.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,"查询成功",wxMallService.getById(id)); | |||||
| } | |||||
| } | |||||
| @@ -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.WxMallFloor; | |||||
| import com.simple.service.WxMallFloorService; | |||||
| import io.swagger.annotations.ApiImplicitParam; | |||||
| import io.swagger.annotations.ApiImplicitParams; | |||||
| import io.swagger.annotations.ApiOperation; | |||||
| @RestController | |||||
| @RequestMapping("wxMallFloor") | |||||
| public class WxMallFloorController extends BaseController | |||||
| { | |||||
| @Autowired | |||||
| private WxMallFloorService wxMallFloorService; | |||||
| private Logger logger = Logger.getLogger(WxMallFloorController.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 WxMallFloor wxMallFloor,Integer pageNum, Integer pageSize) { | |||||
| if (null == wxMallFloor) wxMallFloor = new WxMallFloor(); | |||||
| final PageInfo<WxMallFloor> page = wxMallFloorService.listAsPage(wxMallFloor, pageNum, pageSize); | |||||
| return new ResultData(page); | |||||
| } | |||||
| @ApiOperation("新增接口") | |||||
| @PostMapping("add") | |||||
| public ResultData add(@RequestBody WxMallFloor wxMallFloor) { | |||||
| //Assert.notNull(wxMallFloor.getName(), "角色名不能为空"); | |||||
| //Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名"); | |||||
| wxMallFloorService.saveOrUpdate(wxMallFloor); | |||||
| return new ResultData(); | |||||
| } | |||||
| @ApiOperation("根据id更新接口") | |||||
| @PostMapping("update") | |||||
| public ResultData update(@RequestBody WxMallFloor wxMallFloor) { | |||||
| wxMallFloorService.saveOrUpdate(wxMallFloor); | |||||
| return new ResultData(); | |||||
| } | |||||
| @ApiOperation("根据id删除接口") | |||||
| @GetMapping("/del") | |||||
| @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | |||||
| public ResultData delete(Long id) { | |||||
| wxMallFloorService.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,"查询成功",wxMallFloorService.getById(id)); | |||||
| } | |||||
| } | |||||
| @@ -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.WxMerchantBUser; | |||||
| import com.simple.service.WxMerchantBUserService; | |||||
| import io.swagger.annotations.ApiImplicitParam; | |||||
| import io.swagger.annotations.ApiImplicitParams; | |||||
| import io.swagger.annotations.ApiOperation; | |||||
| @RestController | |||||
| @RequestMapping("wxMerchantBUser") | |||||
| public class WxMerchantBUserController extends BaseController | |||||
| { | |||||
| @Autowired | |||||
| private WxMerchantBUserService wxMerchantBUserService; | |||||
| private Logger logger = Logger.getLogger(WxMerchantBUserController.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 WxMerchantBUser wxMerchantBUser,Integer pageNum, Integer pageSize) { | |||||
| if (null == wxMerchantBUser) wxMerchantBUser = new WxMerchantBUser(); | |||||
| final PageInfo<WxMerchantBUser> page = wxMerchantBUserService.listAsPage(wxMerchantBUser, pageNum, pageSize); | |||||
| return new ResultData(page); | |||||
| } | |||||
| @ApiOperation("新增接口") | |||||
| @PostMapping("add") | |||||
| public ResultData add(@RequestBody WxMerchantBUser wxMerchantBUser) { | |||||
| //Assert.notNull(wxMerchantBUser.getName(), "角色名不能为空"); | |||||
| //Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名"); | |||||
| wxMerchantBUserService.saveOrUpdate(wxMerchantBUser); | |||||
| return new ResultData(); | |||||
| } | |||||
| @ApiOperation("根据id更新接口") | |||||
| @PostMapping("update") | |||||
| public ResultData update(@RequestBody WxMerchantBUser wxMerchantBUser) { | |||||
| wxMerchantBUserService.saveOrUpdate(wxMerchantBUser); | |||||
| return new ResultData(); | |||||
| } | |||||
| @ApiOperation("根据id删除接口") | |||||
| @GetMapping("/del") | |||||
| @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | |||||
| public ResultData delete(Long id) { | |||||
| wxMerchantBUserService.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,"查询成功",wxMerchantBUserService.getById(id)); | |||||
| } | |||||
| } | |||||
| @@ -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.WxMerchant; | |||||
| import com.simple.service.WxMerchantService; | |||||
| import io.swagger.annotations.ApiImplicitParam; | |||||
| import io.swagger.annotations.ApiImplicitParams; | |||||
| import io.swagger.annotations.ApiOperation; | |||||
| @RestController | |||||
| @RequestMapping("wxMerchant") | |||||
| public class WxMerchantController extends BaseController | |||||
| { | |||||
| @Autowired | |||||
| private WxMerchantService wxMerchantService; | |||||
| private Logger logger = Logger.getLogger(WxMerchantController.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 WxMerchant wxMerchant,Integer pageNum, Integer pageSize) { | |||||
| if (null == wxMerchant) wxMerchant = new WxMerchant(); | |||||
| final PageInfo<WxMerchant> page = wxMerchantService.listAsPage(wxMerchant, pageNum, pageSize); | |||||
| return new ResultData(page); | |||||
| } | |||||
| @ApiOperation("新增接口") | |||||
| @PostMapping("add") | |||||
| public ResultData add(@RequestBody WxMerchant wxMerchant) { | |||||
| //Assert.notNull(wxMerchant.getName(), "角色名不能为空"); | |||||
| //Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名"); | |||||
| wxMerchantService.saveOrUpdate(wxMerchant); | |||||
| return new ResultData(); | |||||
| } | |||||
| @ApiOperation("根据id更新接口") | |||||
| @PostMapping("update") | |||||
| public ResultData update(@RequestBody WxMerchant wxMerchant) { | |||||
| wxMerchantService.saveOrUpdate(wxMerchant); | |||||
| return new ResultData(); | |||||
| } | |||||
| @ApiOperation("根据id删除接口") | |||||
| @GetMapping("/del") | |||||
| @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | |||||
| public ResultData delete(Long id) { | |||||
| wxMerchantService.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,"查询成功",wxMerchantService.getById(id)); | |||||
| } | |||||
| } | |||||
| @@ -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.WxMerchantShop; | |||||
| import com.simple.service.WxMerchantShopService; | |||||
| import io.swagger.annotations.ApiImplicitParam; | |||||
| import io.swagger.annotations.ApiImplicitParams; | |||||
| import io.swagger.annotations.ApiOperation; | |||||
| @RestController | |||||
| @RequestMapping("wxMerchantShop") | |||||
| public class WxMerchantShopController extends BaseController | |||||
| { | |||||
| @Autowired | |||||
| private WxMerchantShopService wxMerchantShopService; | |||||
| private Logger logger = Logger.getLogger(WxMerchantShopController.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 WxMerchantShop wxMerchantShop,Integer pageNum, Integer pageSize) { | |||||
| if (null == wxMerchantShop) wxMerchantShop = new WxMerchantShop(); | |||||
| final PageInfo<WxMerchantShop> page = wxMerchantShopService.listAsPage(wxMerchantShop, pageNum, pageSize); | |||||
| return new ResultData(page); | |||||
| } | |||||
| @ApiOperation("新增接口") | |||||
| @PostMapping("add") | |||||
| public ResultData add(@RequestBody WxMerchantShop wxMerchantShop) { | |||||
| //Assert.notNull(wxMerchantShop.getName(), "角色名不能为空"); | |||||
| //Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名"); | |||||
| wxMerchantShopService.saveOrUpdate(wxMerchantShop); | |||||
| return new ResultData(); | |||||
| } | |||||
| @ApiOperation("根据id更新接口") | |||||
| @PostMapping("update") | |||||
| public ResultData update(@RequestBody WxMerchantShop wxMerchantShop) { | |||||
| wxMerchantShopService.saveOrUpdate(wxMerchantShop); | |||||
| return new ResultData(); | |||||
| } | |||||
| @ApiOperation("根据id删除接口") | |||||
| @GetMapping("/del") | |||||
| @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | |||||
| public ResultData delete(Long id) { | |||||
| wxMerchantShopService.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,"查询成功",wxMerchantShopService.getById(id)); | |||||
| } | |||||
| } | |||||
| @@ -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.WxMerchantTradeDaily; | |||||
| import com.simple.service.WxMerchantTradeDailyService; | |||||
| import io.swagger.annotations.ApiImplicitParam; | |||||
| import io.swagger.annotations.ApiImplicitParams; | |||||
| import io.swagger.annotations.ApiOperation; | |||||
| @RestController | |||||
| @RequestMapping("wxMerchantTradeDaily") | |||||
| public class WxMerchantTradeDailyController extends BaseController | |||||
| { | |||||
| @Autowired | |||||
| private WxMerchantTradeDailyService wxMerchantTradeDailyService; | |||||
| private Logger logger = Logger.getLogger(WxMerchantTradeDailyController.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 WxMerchantTradeDaily wxMerchantTradeDaily,Integer pageNum, Integer pageSize) { | |||||
| if (null == wxMerchantTradeDaily) wxMerchantTradeDaily = new WxMerchantTradeDaily(); | |||||
| final PageInfo<WxMerchantTradeDaily> page = wxMerchantTradeDailyService.listAsPage(wxMerchantTradeDaily, pageNum, pageSize); | |||||
| return new ResultData(page); | |||||
| } | |||||
| @ApiOperation("新增接口") | |||||
| @PostMapping("add") | |||||
| public ResultData add(@RequestBody WxMerchantTradeDaily wxMerchantTradeDaily) { | |||||
| //Assert.notNull(wxMerchantTradeDaily.getName(), "角色名不能为空"); | |||||
| //Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名"); | |||||
| wxMerchantTradeDailyService.saveOrUpdate(wxMerchantTradeDaily); | |||||
| return new ResultData(); | |||||
| } | |||||
| @ApiOperation("根据id更新接口") | |||||
| @PostMapping("update") | |||||
| public ResultData update(@RequestBody WxMerchantTradeDaily wxMerchantTradeDaily) { | |||||
| wxMerchantTradeDailyService.saveOrUpdate(wxMerchantTradeDaily); | |||||
| return new ResultData(); | |||||
| } | |||||
| @ApiOperation("根据id删除接口") | |||||
| @GetMapping("/del") | |||||
| @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | |||||
| public ResultData delete(Long id) { | |||||
| wxMerchantTradeDailyService.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,"查询成功",wxMerchantTradeDailyService.getById(id)); | |||||
| } | |||||
| } | |||||
| @@ -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.WxMsgCallback; | |||||
| import com.simple.service.WxMsgCallbackService; | |||||
| import io.swagger.annotations.ApiImplicitParam; | |||||
| import io.swagger.annotations.ApiImplicitParams; | |||||
| import io.swagger.annotations.ApiOperation; | |||||
| @RestController | |||||
| @RequestMapping("wxMsgCallback") | |||||
| public class WxMsgCallbackController extends BaseController | |||||
| { | |||||
| @Autowired | |||||
| private WxMsgCallbackService wxMsgCallbackService; | |||||
| private Logger logger = Logger.getLogger(WxMsgCallbackController.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 WxMsgCallback wxMsgCallback,Integer pageNum, Integer pageSize) { | |||||
| if (null == wxMsgCallback) wxMsgCallback = new WxMsgCallback(); | |||||
| final PageInfo<WxMsgCallback> page = wxMsgCallbackService.listAsPage(wxMsgCallback, pageNum, pageSize); | |||||
| return new ResultData(page); | |||||
| } | |||||
| @ApiOperation("新增接口") | |||||
| @PostMapping("add") | |||||
| public ResultData add(@RequestBody WxMsgCallback wxMsgCallback) { | |||||
| //Assert.notNull(wxMsgCallback.getName(), "角色名不能为空"); | |||||
| //Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名"); | |||||
| wxMsgCallbackService.saveOrUpdate(wxMsgCallback); | |||||
| return new ResultData(); | |||||
| } | |||||
| @ApiOperation("根据id更新接口") | |||||
| @PostMapping("update") | |||||
| public ResultData update(@RequestBody WxMsgCallback wxMsgCallback) { | |||||
| wxMsgCallbackService.saveOrUpdate(wxMsgCallback); | |||||
| return new ResultData(); | |||||
| } | |||||
| @ApiOperation("根据id删除接口") | |||||
| @GetMapping("/del") | |||||
| @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | |||||
| public ResultData delete(Long id) { | |||||
| wxMsgCallbackService.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,"查询成功",wxMsgCallbackService.getById(id)); | |||||
| } | |||||
| } | |||||
| @@ -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.WxMsgConfig; | |||||
| import com.simple.service.WxMsgConfigService; | |||||
| import io.swagger.annotations.ApiImplicitParam; | |||||
| import io.swagger.annotations.ApiImplicitParams; | |||||
| import io.swagger.annotations.ApiOperation; | |||||
| @RestController | |||||
| @RequestMapping("wxMsgConfig") | |||||
| public class WxMsgConfigController extends BaseController | |||||
| { | |||||
| @Autowired | |||||
| private WxMsgConfigService wxMsgConfigService; | |||||
| private Logger logger = Logger.getLogger(WxMsgConfigController.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 WxMsgConfig wxMsgConfig,Integer pageNum, Integer pageSize) { | |||||
| if (null == wxMsgConfig) wxMsgConfig = new WxMsgConfig(); | |||||
| final PageInfo<WxMsgConfig> page = wxMsgConfigService.listAsPage(wxMsgConfig, pageNum, pageSize); | |||||
| return new ResultData(page); | |||||
| } | |||||
| @ApiOperation("新增接口") | |||||
| @PostMapping("add") | |||||
| public ResultData add(@RequestBody WxMsgConfig wxMsgConfig) { | |||||
| //Assert.notNull(wxMsgConfig.getName(), "角色名不能为空"); | |||||
| //Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名"); | |||||
| wxMsgConfigService.saveOrUpdate(wxMsgConfig); | |||||
| return new ResultData(); | |||||
| } | |||||
| @ApiOperation("根据id更新接口") | |||||
| @PostMapping("update") | |||||
| public ResultData update(@RequestBody WxMsgConfig wxMsgConfig) { | |||||
| wxMsgConfigService.saveOrUpdate(wxMsgConfig); | |||||
| return new ResultData(); | |||||
| } | |||||
| @ApiOperation("根据id删除接口") | |||||
| @GetMapping("/del") | |||||
| @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | |||||
| public ResultData delete(Long id) { | |||||
| wxMsgConfigService.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,"查询成功",wxMsgConfigService.getById(id)); | |||||
| } | |||||
| } | |||||
| @@ -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.WxMsg; | |||||
| import com.simple.service.WxMsgService; | |||||
| import io.swagger.annotations.ApiImplicitParam; | |||||
| import io.swagger.annotations.ApiImplicitParams; | |||||
| import io.swagger.annotations.ApiOperation; | |||||
| @RestController | |||||
| @RequestMapping("wxMsg") | |||||
| public class WxMsgController extends BaseController | |||||
| { | |||||
| @Autowired | |||||
| private WxMsgService wxMsgService; | |||||
| private Logger logger = Logger.getLogger(WxMsgController.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 WxMsg wxMsg,Integer pageNum, Integer pageSize) { | |||||
| if (null == wxMsg) wxMsg = new WxMsg(); | |||||
| final PageInfo<WxMsg> page = wxMsgService.listAsPage(wxMsg, pageNum, pageSize); | |||||
| return new ResultData(page); | |||||
| } | |||||
| @ApiOperation("新增接口") | |||||
| @PostMapping("add") | |||||
| public ResultData add(@RequestBody WxMsg wxMsg) { | |||||
| //Assert.notNull(wxMsg.getName(), "角色名不能为空"); | |||||
| //Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名"); | |||||
| wxMsgService.saveOrUpdate(wxMsg); | |||||
| return new ResultData(); | |||||
| } | |||||
| @ApiOperation("根据id更新接口") | |||||
| @PostMapping("update") | |||||
| public ResultData update(@RequestBody WxMsg wxMsg) { | |||||
| wxMsgService.saveOrUpdate(wxMsg); | |||||
| return new ResultData(); | |||||
| } | |||||
| @ApiOperation("根据id删除接口") | |||||
| @GetMapping("/del") | |||||
| @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | |||||
| public ResultData delete(Long id) { | |||||
| wxMsgService.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,"查询成功",wxMsgService.getById(id)); | |||||
| } | |||||
| } | |||||
| @@ -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.WxMsgModel; | |||||
| import com.simple.service.WxMsgModelService; | |||||
| import io.swagger.annotations.ApiImplicitParam; | |||||
| import io.swagger.annotations.ApiImplicitParams; | |||||
| import io.swagger.annotations.ApiOperation; | |||||
| @RestController | |||||
| @RequestMapping("wxMsgModel") | |||||
| public class WxMsgModelController extends BaseController | |||||
| { | |||||
| @Autowired | |||||
| private WxMsgModelService wxMsgModelService; | |||||
| private Logger logger = Logger.getLogger(WxMsgModelController.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 WxMsgModel wxMsgModel,Integer pageNum, Integer pageSize) { | |||||
| if (null == wxMsgModel) wxMsgModel = new WxMsgModel(); | |||||
| final PageInfo<WxMsgModel> page = wxMsgModelService.listAsPage(wxMsgModel, pageNum, pageSize); | |||||
| return new ResultData(page); | |||||
| } | |||||
| @ApiOperation("新增接口") | |||||
| @PostMapping("add") | |||||
| public ResultData add(@RequestBody WxMsgModel wxMsgModel) { | |||||
| //Assert.notNull(wxMsgModel.getName(), "角色名不能为空"); | |||||
| //Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名"); | |||||
| wxMsgModelService.saveOrUpdate(wxMsgModel); | |||||
| return new ResultData(); | |||||
| } | |||||
| @ApiOperation("根据id更新接口") | |||||
| @PostMapping("update") | |||||
| public ResultData update(@RequestBody WxMsgModel wxMsgModel) { | |||||
| wxMsgModelService.saveOrUpdate(wxMsgModel); | |||||
| return new ResultData(); | |||||
| } | |||||
| @ApiOperation("根据id删除接口") | |||||
| @GetMapping("/del") | |||||
| @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | |||||
| public ResultData delete(Long id) { | |||||
| wxMsgModelService.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,"查询成功",wxMsgModelService.getById(id)); | |||||
| } | |||||
| } | |||||
| @@ -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.WxMsgSignature; | |||||
| import com.simple.service.WxMsgSignatureService; | |||||
| import io.swagger.annotations.ApiImplicitParam; | |||||
| import io.swagger.annotations.ApiImplicitParams; | |||||
| import io.swagger.annotations.ApiOperation; | |||||
| @RestController | |||||
| @RequestMapping("wxMsgSignature") | |||||
| public class WxMsgSignatureController extends BaseController | |||||
| { | |||||
| @Autowired | |||||
| private WxMsgSignatureService wxMsgSignatureService; | |||||
| private Logger logger = Logger.getLogger(WxMsgSignatureController.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 WxMsgSignature wxMsgSignature,Integer pageNum, Integer pageSize) { | |||||
| if (null == wxMsgSignature) wxMsgSignature = new WxMsgSignature(); | |||||
| final PageInfo<WxMsgSignature> page = wxMsgSignatureService.listAsPage(wxMsgSignature, pageNum, pageSize); | |||||
| return new ResultData(page); | |||||
| } | |||||
| @ApiOperation("新增接口") | |||||
| @PostMapping("add") | |||||
| public ResultData add(@RequestBody WxMsgSignature wxMsgSignature) { | |||||
| //Assert.notNull(wxMsgSignature.getName(), "角色名不能为空"); | |||||
| //Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名"); | |||||
| wxMsgSignatureService.saveOrUpdate(wxMsgSignature); | |||||
| return new ResultData(); | |||||
| } | |||||
| @ApiOperation("根据id更新接口") | |||||
| @PostMapping("update") | |||||
| public ResultData update(@RequestBody WxMsgSignature wxMsgSignature) { | |||||
| wxMsgSignatureService.saveOrUpdate(wxMsgSignature); | |||||
| return new ResultData(); | |||||
| } | |||||
| @ApiOperation("根据id删除接口") | |||||
| @GetMapping("/del") | |||||
| @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | |||||
| public ResultData delete(Long id) { | |||||
| wxMsgSignatureService.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,"查询成功",wxMsgSignatureService.getById(id)); | |||||
| } | |||||
| } | |||||
| @@ -2,8 +2,14 @@ package com.simple.controller; | |||||
| import com.simple.common.ErrorCode; | import com.simple.common.ErrorCode; | ||||
| import com.simple.domain.po.WxCUser; | import com.simple.domain.po.WxCUser; | ||||
| import com.simple.domain.po.WxCouponChannel; | |||||
| import com.simple.domain.vo.WxOrderCVo; | |||||
| import com.simple.enums.EnumCouponChannelStatus; | |||||
| import com.simple.enums.EnumCouponStatus; | |||||
| import com.simple.enums.EnumOrderStatus; | import com.simple.enums.EnumOrderStatus; | ||||
| import com.simple.exception.MallinkException; | import com.simple.exception.MallinkException; | ||||
| import com.simple.service.WxCouponChannelService; | |||||
| import io.swagger.annotations.Api; | |||||
| import org.apache.commons.lang3.StringUtils; | import org.apache.commons.lang3.StringUtils; | ||||
| import org.apache.log4j.Logger; | import org.apache.log4j.Logger; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| @@ -23,27 +29,44 @@ import java.util.Map; | |||||
| @RestController | @RestController | ||||
| @RequestMapping("/api/order/") | @RequestMapping("/api/order/") | ||||
| @Api(description = "订单相关接口") | |||||
| public class WxOrderController extends BaseController { | public class WxOrderController extends BaseController { | ||||
| private Logger logger = Logger.getLogger(WxOrderController.class); | private Logger logger = Logger.getLogger(WxOrderController.class); | ||||
| @Autowired | |||||
| private WxCouponChannelService wxCouponChannelService; | |||||
| @Autowired | @Autowired | ||||
| private WxOrderService wxOrderService; | private WxOrderService wxOrderService; | ||||
| @ApiOperation(value = "免费领取", notes = "{\"couponId\":\"String\"}") | |||||
| @ApiOperation(value = "免费领取", notes = "{\"couponChannelId\":\"String\",\"couponId\":\"String\"}") | |||||
| @PostMapping("freeCoupon") | @PostMapping("freeCoupon") | ||||
| public ResultData freeCoupon(@RequestBody Map<String, String> paramMap) { | public ResultData freeCoupon(@RequestBody Map<String, String> paramMap) { | ||||
| //Assert.notNull(wxOrders.getName(), "角色名不能为空"); | //Assert.notNull(wxOrders.getName(), "角色名不能为空"); | ||||
| //Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名"); | //Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名"); | ||||
| String couponChannelIdStr = paramMap.get("couponChannelId"); | |||||
| String couponIdStr = paramMap.get("couponId"); | String couponIdStr = paramMap.get("couponId"); | ||||
| if (StringUtils.isBlank(couponIdStr)) { | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "couponId不能为空"); | |||||
| if (StringUtils.isBlank(couponChannelIdStr)) { | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "couponChannelId不能为空"); | |||||
| } | } | ||||
| Long couponId = 0L; | |||||
| Long couponChannelId = 0L, couponId = 0L; | |||||
| try { | try { | ||||
| couponId = Long.valueOf(couponIdStr); | |||||
| couponChannelId = Long.valueOf(couponChannelIdStr); | |||||
| } catch (NumberFormatException e) { | } catch (NumberFormatException e) { | ||||
| logger.error("couponId convert error, " + couponIdStr + ", e:" + e.getMessage()); | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_CAST_ERROR.getCode(), "couponId: " + couponIdStr + ", e:" + e.getMessage()); | |||||
| logger.error("couponChannelId convert error, " + couponChannelIdStr + ", e:" + e.getMessage()); | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_CAST_ERROR.getCode(), "couponChannelId: " + couponChannelIdStr + ", e:" + e.getMessage()); | |||||
| } | |||||
| WxCouponChannel wxCouponChannel = wxCouponChannelService.getById(couponChannelId); | |||||
| if (wxCouponChannel == null) { | |||||
| logger.error("couponChannelId convert error, " + couponChannelIdStr); | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_CAST_ERROR.getCode(), "找不到发布的频道"); | |||||
| } | |||||
| if (wxCouponChannel.getStatus() == EnumCouponChannelStatus.STATUS_TAKE_OFFF.getCode()) { | |||||
| logger.error("此券已下架:" + couponChannelIdStr); | |||||
| return new ResultData(ErrorCode.COUPON_IS_TAKE_OFF.getCode(), "此券已下架"); | |||||
| } | |||||
| if (StringUtils.isBlank(couponIdStr)) { | |||||
| couponId = wxCouponChannel.getCouponId(); | |||||
| } | } | ||||
| WxCUser user = getUser(); | WxCUser user = getUser(); | ||||
| @@ -62,21 +85,34 @@ public class WxOrderController extends BaseController { | |||||
| } | } | ||||
| } | } | ||||
| @ApiOperation(value = "下订单", notes = "{\"couponId\":\"String\"}") | |||||
| @ApiOperation(value = "下订单", notes = "{\"couponChannelId\":\"String\",\"couponId\":\"String\"}") | |||||
| @PostMapping("save") | @PostMapping("save") | ||||
| public ResultData saveOrder(@RequestBody Map<String, String> paramMap) { | public ResultData saveOrder(@RequestBody Map<String, String> paramMap) { | ||||
| //Assert.notNull(wxOrders.getName(), "角色名不能为空"); | //Assert.notNull(wxOrders.getName(), "角色名不能为空"); | ||||
| //Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名"); | //Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名"); | ||||
| String couponChannelIdStr = paramMap.get("couponChannelId"); | |||||
| String couponIdStr = paramMap.get("couponId"); | String couponIdStr = paramMap.get("couponId"); | ||||
| if (StringUtils.isBlank(couponIdStr)) { | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "couponId不能为空"); | |||||
| if (StringUtils.isBlank(couponChannelIdStr)) { | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "couponChannelId不能为空"); | |||||
| } | } | ||||
| Long couponId = 0L; | |||||
| Long couponChannelId = 0L, couponId = 0L; | |||||
| try { | try { | ||||
| couponId = Long.valueOf(couponIdStr); | |||||
| couponChannelId = Long.valueOf(couponChannelIdStr); | |||||
| } catch (NumberFormatException e) { | } catch (NumberFormatException e) { | ||||
| logger.error("couponId convert error, " + couponIdStr + ", e:" + e.getMessage()); | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_CAST_ERROR.getCode(), "couponId: " + couponIdStr + ", e:" + e.getMessage()); | |||||
| logger.error("couponChannelId convert error, " + couponChannelIdStr + ", e:" + e.getMessage()); | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_CAST_ERROR.getCode(), "couponChannelId: " + couponChannelIdStr + ", e:" + e.getMessage()); | |||||
| } | |||||
| WxCouponChannel wxCouponChannel = wxCouponChannelService.getById(couponChannelId); | |||||
| if (wxCouponChannel == null) { | |||||
| logger.error("couponChannelId convert error, " + couponChannelIdStr); | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_CAST_ERROR.getCode(), "找不到发布的频道"); | |||||
| } | |||||
| if (wxCouponChannel.getStatus() == EnumCouponChannelStatus.STATUS_TAKE_OFFF.getCode()) { | |||||
| logger.error("此券已下架:" + couponChannelIdStr); | |||||
| return new ResultData(ErrorCode.COUPON_IS_TAKE_OFF.getCode(), "此券已下架"); | |||||
| } | |||||
| if (StringUtils.isBlank(couponIdStr)) { | |||||
| couponId = wxCouponChannel.getCouponId(); | |||||
| } | } | ||||
| WxCUser user = getUser(); | WxCUser user = getUser(); | ||||
| @@ -156,18 +192,26 @@ public class WxOrderController extends BaseController { | |||||
| @ApiImplicitParams({ | @ApiImplicitParams({ | ||||
| @ApiImplicitParam(name="pageNum",value="页数",dataType="int", paramType = "query",required=true), | @ApiImplicitParam(name="pageNum",value="页数",dataType="int", paramType = "query",required=true), | ||||
| @ApiImplicitParam(name="pageSize",value="每页条数",dataType="int", paramType = "query",required=true), | @ApiImplicitParam(name="pageSize",value="每页条数",dataType="int", paramType = "query",required=true), | ||||
| @ApiImplicitParam(name="orderStatus",value="订单状态0-已下单/待付款;1-已支付;2-已取消",dataType="int", paramType = "query",required=false) | |||||
| }) | }) | ||||
| public ResultData list(Integer orderStatus, Integer pageNum, Integer pageSize) { | |||||
| public ResultData list(@ModelAttribute WxOrder wxOrder, Integer pageNum, Integer pageSize) { | |||||
| // c端用户应该只能看到自己的订单 | // c端用户应该只能看到自己的订单 | ||||
| WxCUser user = getUser(); | |||||
| WxOrder wxOrderQ = new WxOrder(); | |||||
| wxOrderQ.setCUserId(user.getId()); | |||||
| wxOrderQ.setOrderStatus(orderStatus); | |||||
| final PageInfo<WxOrder> page = wxOrderService.listAsPage(wxOrderQ, pageNum, pageSize); | |||||
| if (wxOrder == null) wxOrder = new WxOrder(); | |||||
| wxOrder.setCUserId(getUser().getId()); | |||||
| final PageInfo<WxOrderCVo> page = wxOrderService.listCUserVoAsPage(wxOrder, pageNum, pageSize); | |||||
| return new ResultData(page); | return new ResultData(page); | ||||
| } | } | ||||
| @ApiOperation("订单详情接口") | |||||
| @GetMapping("detail") | |||||
| public ResultData list(@ModelAttribute WxOrder wxOrder) { | |||||
| // c端用户应该只能看到自己的订单细节 | |||||
| if (wxOrder == null) wxOrder = new WxOrder(); | |||||
| wxOrder.setCUserId(getUser().getId()); | |||||
| WxOrderCVo wxOrderCVo = wxOrderService.detailCUserVo(wxOrder); | |||||
| if (wxOrderCVo == null) | |||||
| return new ResultData(ErrorCode.ORDER_IS_NOT_FIND); | |||||
| return new ResultData(wxOrderCVo); | |||||
| } | |||||
| @ApiOperation(value = "根据orderId查询接口", notes = "{\"orderId\":\"string\"}") | @ApiOperation(value = "根据orderId查询接口", notes = "{\"orderId\":\"string\"}") | ||||
| @GetMapping("/findById") | @GetMapping("/findById") | ||||
| public ResultData findById(@RequestBody Map<String, String> paramMap) { | public ResultData findById(@RequestBody Map<String, String> paramMap) { | ||||
| @@ -8,6 +8,7 @@ import com.simple.domain.po.WxCUser; | |||||
| import com.simple.domain.po.WxPark; | import com.simple.domain.po.WxPark; | ||||
| import com.simple.pay.WxPay; | import com.simple.pay.WxPay; | ||||
| import com.simple.service.WxParkService; | import com.simple.service.WxParkService; | ||||
| import io.swagger.annotations.Api; | |||||
| import io.swagger.annotations.ApiImplicitParam; | import io.swagger.annotations.ApiImplicitParam; | ||||
| import io.swagger.annotations.ApiImplicitParams; | import io.swagger.annotations.ApiImplicitParams; | ||||
| import io.swagger.annotations.ApiOperation; | import io.swagger.annotations.ApiOperation; | ||||
| @@ -17,6 +18,7 @@ import org.springframework.web.bind.annotation.*; | |||||
| @RestController | @RestController | ||||
| @RequestMapping("/api/wxPark") | @RequestMapping("/api/wxPark") | ||||
| @Api(description = "停车相关接口接口") | |||||
| public class WxParkController extends BaseController { | public class WxParkController extends BaseController { | ||||
| private Logger logger = Logger.getLogger(WxParkController.class); | private Logger logger = Logger.getLogger(WxParkController.class); | ||||
| @@ -12,6 +12,7 @@ import com.simple.exception.BizMessageException; | |||||
| import com.simple.exception.MallinkException; | import com.simple.exception.MallinkException; | ||||
| import com.simple.pay.WxPayment; | import com.simple.pay.WxPayment; | ||||
| import com.simple.utils.IPUtil; | import com.simple.utils.IPUtil; | ||||
| import io.swagger.annotations.Api; | |||||
| import org.apache.commons.lang3.StringUtils; | import org.apache.commons.lang3.StringUtils; | ||||
| import org.apache.log4j.Logger; | import org.apache.log4j.Logger; | ||||
| import org.apache.commons.io.IOUtils; | import org.apache.commons.io.IOUtils; | ||||
| @@ -36,6 +37,7 @@ import java.util.Map; | |||||
| @RestController | @RestController | ||||
| @RequestMapping("/api/pay") | @RequestMapping("/api/pay") | ||||
| @Api(description = "支付相关接口") | |||||
| public class WxPayOrderController extends BaseController { | public class WxPayOrderController extends BaseController { | ||||
| private Logger logger = Logger.getLogger(WxPayOrderController.class); | private Logger logger = Logger.getLogger(WxPayOrderController.class); | ||||
| @@ -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.WxScoreRules; | |||||
| import com.simple.service.WxScoreRulesService; | |||||
| import io.swagger.annotations.ApiImplicitParam; | |||||
| import io.swagger.annotations.ApiImplicitParams; | |||||
| import io.swagger.annotations.ApiOperation; | |||||
| @RestController | |||||
| @RequestMapping("wxScoreRules") | |||||
| public class WxScoreRulesController extends BaseController | |||||
| { | |||||
| @Autowired | |||||
| private WxScoreRulesService wxScoreRulesService; | |||||
| private Logger logger = Logger.getLogger(WxScoreRulesController.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 WxScoreRules wxScoreRules,Integer pageNum, Integer pageSize) { | |||||
| if (null == wxScoreRules) wxScoreRules = new WxScoreRules(); | |||||
| final PageInfo<WxScoreRules> page = wxScoreRulesService.listAsPage(wxScoreRules, pageNum, pageSize); | |||||
| return new ResultData(page); | |||||
| } | |||||
| @ApiOperation("新增接口") | |||||
| @PostMapping("add") | |||||
| public ResultData add(@RequestBody WxScoreRules wxScoreRules) { | |||||
| //Assert.notNull(wxScoreRules.getName(), "角色名不能为空"); | |||||
| //Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名"); | |||||
| wxScoreRulesService.saveOrUpdate(wxScoreRules); | |||||
| return new ResultData(); | |||||
| } | |||||
| @ApiOperation("根据id更新接口") | |||||
| @PostMapping("update") | |||||
| public ResultData update(@RequestBody WxScoreRules wxScoreRules) { | |||||
| wxScoreRulesService.saveOrUpdate(wxScoreRules); | |||||
| return new ResultData(); | |||||
| } | |||||
| @ApiOperation("根据id删除接口") | |||||
| @GetMapping("/del") | |||||
| @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | |||||
| public ResultData delete(Long id) { | |||||
| wxScoreRulesService.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,"查询成功",wxScoreRulesService.getById(id)); | |||||
| } | |||||
| } | |||||
| @@ -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.WxScoreValidityPeriod; | |||||
| import com.simple.service.WxScoreValidityPeriodService; | |||||
| import io.swagger.annotations.ApiImplicitParam; | |||||
| import io.swagger.annotations.ApiImplicitParams; | |||||
| import io.swagger.annotations.ApiOperation; | |||||
| @RestController | |||||
| @RequestMapping("wxScoreValidityPeriod") | |||||
| public class WxScoreValidityPeriodController extends BaseController | |||||
| { | |||||
| @Autowired | |||||
| private WxScoreValidityPeriodService wxScoreValidityPeriodService; | |||||
| private Logger logger = Logger.getLogger(WxScoreValidityPeriodController.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 WxScoreValidityPeriod wxScoreValidityPeriod,Integer pageNum, Integer pageSize) { | |||||
| if (null == wxScoreValidityPeriod) wxScoreValidityPeriod = new WxScoreValidityPeriod(); | |||||
| final PageInfo<WxScoreValidityPeriod> page = wxScoreValidityPeriodService.listAsPage(wxScoreValidityPeriod, pageNum, pageSize); | |||||
| return new ResultData(page); | |||||
| } | |||||
| @ApiOperation("新增接口") | |||||
| @PostMapping("add") | |||||
| public ResultData add(@RequestBody WxScoreValidityPeriod wxScoreValidityPeriod) { | |||||
| //Assert.notNull(wxScoreValidityPeriod.getName(), "角色名不能为空"); | |||||
| //Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名"); | |||||
| wxScoreValidityPeriodService.saveOrUpdate(wxScoreValidityPeriod); | |||||
| return new ResultData(); | |||||
| } | |||||
| @ApiOperation("根据id更新接口") | |||||
| @PostMapping("update") | |||||
| public ResultData update(@RequestBody WxScoreValidityPeriod wxScoreValidityPeriod) { | |||||
| wxScoreValidityPeriodService.saveOrUpdate(wxScoreValidityPeriod); | |||||
| return new ResultData(); | |||||
| } | |||||
| @ApiOperation("根据id删除接口") | |||||
| @GetMapping("/del") | |||||
| @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | |||||
| public ResultData delete(Long id) { | |||||
| wxScoreValidityPeriodService.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,"查询成功",wxScoreValidityPeriodService.getById(id)); | |||||
| } | |||||
| } | |||||
| @@ -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.WxShop; | |||||
| import com.simple.service.WxShopService; | |||||
| import io.swagger.annotations.ApiImplicitParam; | |||||
| import io.swagger.annotations.ApiImplicitParams; | |||||
| import io.swagger.annotations.ApiOperation; | |||||
| @RestController | |||||
| @RequestMapping("wxShop") | |||||
| public class WxShopController extends BaseController | |||||
| { | |||||
| @Autowired | |||||
| private WxShopService wxShopService; | |||||
| private Logger logger = Logger.getLogger(WxShopController.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 WxShop wxShop,Integer pageNum, Integer pageSize) { | |||||
| if (null == wxShop) wxShop = new WxShop(); | |||||
| final PageInfo<WxShop> page = wxShopService.listAsPage(wxShop, pageNum, pageSize); | |||||
| return new ResultData(page); | |||||
| } | |||||
| @ApiOperation("新增接口") | |||||
| @PostMapping("add") | |||||
| public ResultData add(@RequestBody WxShop wxShop) { | |||||
| //Assert.notNull(wxShop.getName(), "角色名不能为空"); | |||||
| //Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名"); | |||||
| wxShopService.saveOrUpdate(wxShop); | |||||
| return new ResultData(); | |||||
| } | |||||
| @ApiOperation("根据id更新接口") | |||||
| @PostMapping("update") | |||||
| public ResultData update(@RequestBody WxShop wxShop) { | |||||
| wxShopService.saveOrUpdate(wxShop); | |||||
| return new ResultData(); | |||||
| } | |||||
| @ApiOperation("根据id删除接口") | |||||
| @GetMapping("/del") | |||||
| @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | |||||
| public ResultData delete(Long id) { | |||||
| wxShopService.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,"查询成功",wxShopService.getById(id)); | |||||
| } | |||||
| } | |||||
| @@ -19,6 +19,7 @@ import com.simple.service.WxAppinfoService; | |||||
| import com.simple.service.WxCUserCarService; | import com.simple.service.WxCUserCarService; | ||||
| import com.simple.service.WxCUserService; | import com.simple.service.WxCUserService; | ||||
| import com.simple.utils.IPUtil; | import com.simple.utils.IPUtil; | ||||
| import io.swagger.annotations.Api; | |||||
| import io.swagger.annotations.ApiImplicitParam; | import io.swagger.annotations.ApiImplicitParam; | ||||
| import io.swagger.annotations.ApiOperation; | import io.swagger.annotations.ApiOperation; | ||||
| import me.chanjar.weixin.common.error.WxErrorException; | import me.chanjar.weixin.common.error.WxErrorException; | ||||
| @@ -38,6 +39,7 @@ import java.util.Map; | |||||
| @RestController | @RestController | ||||
| @RequestMapping("/api/user") | @RequestMapping("/api/user") | ||||
| @Api(description = "用户登陆授权相关接口") | |||||
| public class WxUserGrantController extends BaseController { | public class WxUserGrantController extends BaseController { | ||||
| private final static Logger logger = LoggerFactory.getLogger(WxUserGrantController.class); | private final static Logger logger = LoggerFactory.getLogger(WxUserGrantController.class); | ||||
| @@ -106,6 +108,7 @@ public class WxUserGrantController extends BaseController { | |||||
| user1.setSessionKey(session_key); | user1.setSessionKey(session_key); | ||||
| if (user1.getSceneAddress() == null) | if (user1.getSceneAddress() == null) | ||||
| user1.setSceneAddress(sceneAddress); | user1.setSceneAddress(sceneAddress); | ||||
| // TODO 成长值 | |||||
| wxCUserService.saveOrUpdate(user1); | wxCUserService.saveOrUpdate(user1); | ||||
| resultMap.put("token", token); | resultMap.put("token", token); | ||||
| } else { | } else { | ||||
| @@ -115,8 +118,8 @@ public class WxUserGrantController extends BaseController { | |||||
| user.setRegisterIp(ipaddress); | user.setRegisterIp(ipaddress); | ||||
| if (user.getSceneAddress() == null) | if (user.getSceneAddress() == null) | ||||
| user.setSceneAddress(sceneAddress); | user.setSceneAddress(sceneAddress); | ||||
| user.setSessionKey(session_key); | user.setSessionKey(session_key); | ||||
| // TODO 成长值 | |||||
| wxCUserService.saveOrUpdate(user); | wxCUserService.saveOrUpdate(user); | ||||
| resultMap.put("token", token); | resultMap.put("token", token); | ||||
| } | } | ||||
| @@ -242,13 +245,13 @@ public class WxUserGrantController extends BaseController { | |||||
| public ResultData checkUserStatus() { | public ResultData checkUserStatus() { | ||||
| Map resultMap = new HashMap(); | Map resultMap = new HashMap(); | ||||
| WxCUser user = getUser(); | WxCUser user = getUser(); | ||||
| if (!StringUtils.isBlank(user.getUnionId())) { | |||||
| resultMap.put("unionId", user.getUnionId()); | |||||
| if (!StringUtils.isBlank(user.getNickName())) { | |||||
| resultMap.put("nickName", user.getNickName()); | |||||
| } | |||||
| if (StringUtils.isBlank(user.getNickName())) { | |||||
| logger.warn("用户昵称未授权,跳转到用户授权页!"); | |||||
| return new ResultData(ErrorCode.NICK_NAME_NOT_FOUND.getCode(), "用户昵称未授权,请跳转到用户昵称授权页!", resultMap); | |||||
| } | } | ||||
| //if (StringUtils.isBlank(user.getUnionId())) { | |||||
| // logger.warn("用户昵称未授权,跳转到用户授权页!"); | |||||
| // return new ResultData(ErrorCode.NICK_NAME_NOT_FOUND.getCode(), "用户昵称未授权,请跳转到用户昵称授权页!", resultMap); | |||||
| //} | |||||
| return new ResultData(Result.SUCCESS, "是老用户,已完成所有授权", resultMap); | return new ResultData(Result.SUCCESS, "是老用户,已完成所有授权", resultMap); | ||||
| } | } | ||||
| @@ -53,6 +53,7 @@ public enum ErrorCode{ | |||||
| LOGIN_USER_OR_PWD_ERROR(2002, "用户名或密码错误"), | LOGIN_USER_OR_PWD_ERROR(2002, "用户名或密码错误"), | ||||
| USER_IS_LOCKED(2003, "用户已经被锁定不能登录,请与管理员联系"), | USER_IS_LOCKED(2003, "用户已经被锁定不能登录,请与管理员联系"), | ||||
| NEW_USER_FAILD(2004, "创建新用户失败"), | NEW_USER_FAILD(2004, "创建新用户失败"), | ||||
| BUSER_NOT_IN_APP(2005, "用户不是此app用户"), | |||||
| /** | /** | ||||
| * 商场/商户 | * 商场/商户 | ||||
| @@ -68,6 +69,7 @@ public enum ErrorCode{ | |||||
| */ | */ | ||||
| COUPON_IS_EMPTY(2020, "券不存在"), | COUPON_IS_EMPTY(2020, "券不存在"), | ||||
| COUPON_IS_NOT_FREE(2021, "券不免费"), | COUPON_IS_NOT_FREE(2021, "券不免费"), | ||||
| COUPON_IS_TAKE_OFF(2022, "此券已下架"), | |||||
| /** | /** | ||||
| * 车流 2040 | * 车流 2040 | ||||
| @@ -1,6 +1,7 @@ | |||||
| package com.simple.domain.dto; | package com.simple.domain.dto; | ||||
| import java.io.Serializable; | import java.io.Serializable; | ||||
| import java.util.Date; | |||||
| public class WxCouponChannelDto implements Serializable { | public class WxCouponChannelDto implements Serializable { | ||||
| @@ -8,8 +9,16 @@ public class WxCouponChannelDto implements Serializable { | |||||
| private Long couponId; | private Long couponId; | ||||
| private String couponIds; | private String couponIds; | ||||
| private String channelId; | private String channelId; | ||||
| private Date beginTime; | |||||
| private Date endTime; | |||||
| public Date getEndTime() { | |||||
| return endTime; | |||||
| } | |||||
| public void setEndTime(Date endTime) { | |||||
| this.endTime = endTime; | |||||
| } | |||||
| public String getChannelId() { | public String getChannelId() { | ||||
| return channelId; | return channelId; | ||||
| @@ -34,4 +43,11 @@ public class WxCouponChannelDto implements Serializable { | |||||
| public void setCouponIds(String couponIds) { | public void setCouponIds(String couponIds) { | ||||
| this.couponIds = couponIds; | this.couponIds = couponIds; | ||||
| } | } | ||||
| public Date getBeginTime() { | |||||
| return beginTime; | |||||
| } | |||||
| public void setBeginTime(Date beginTime) { | |||||
| this.beginTime = beginTime; | |||||
| } | |||||
| } | } | ||||
| @@ -33,9 +33,38 @@ public class WxCuerBasicInfoDto implements Serializable{ | |||||
| @Transient | @Transient | ||||
| private String tenantId; | private String tenantId; | ||||
| @Transient | |||||
| private Date birthStartTime; | |||||
| @Transient | |||||
| private Date birthEndTime; | |||||
| @Transient | |||||
| private Integer sex; | |||||
| public Date getBirthStartTime() { | |||||
| return birthStartTime; | |||||
| } | |||||
| public void setBirthStartTime(Date birthStartTime) { | |||||
| this.birthStartTime = birthStartTime; | |||||
| } | |||||
| public Date getBirthEndTime() { | |||||
| return birthEndTime; | |||||
| } | |||||
| public void setBirthEndTime(Date birthEndTime) { | |||||
| this.birthEndTime = birthEndTime; | |||||
| } | |||||
| public Integer getSex() { | |||||
| return sex; | |||||
| } | |||||
| public void setSex(Integer sex) { | |||||
| this.sex = sex; | |||||
| } | |||||
| public String getName() { | public String getName() { | ||||
| return name; | return name; | ||||
| } | } | ||||
| @@ -65,8 +65,14 @@ public class MallUserInfo implements Serializable { | |||||
| /*0 不是超管 1是超管**/ | /*0 不是超管 1是超管**/ | ||||
| @io.swagger.annotations.ApiModelProperty(value="0 不是超管 1是超管",name="isAdmin") | @io.swagger.annotations.ApiModelProperty(value="0 不是超管 1是超管",name="isAdmin") | ||||
| private Integer isAdmin; | private Integer isAdmin; | ||||
| @io.swagger.annotations.ApiModelProperty(value="昵称",name="nickName") | |||||
| private String nickName; | |||||
| @Transient | @Transient | ||||
| private Long roleId; | private Long roleId; | ||||
| @Transient | |||||
| private String roleName; | |||||
| //该用户所有的角色 | //该用户所有的角色 | ||||
| @Transient | @Transient | ||||
| private List<MallRole> role; | private List<MallRole> role; | ||||
| @@ -74,6 +80,7 @@ public class MallUserInfo implements Serializable { | |||||
| @Transient | @Transient | ||||
| private List<MallPermission> permission; | private List<MallPermission> permission; | ||||
| //拥有的菜单权限 | //拥有的菜单权限 | ||||
| @Transient | |||||
| private String menus; | private String menus; | ||||
| public String getMenus() { | public String getMenus() { | ||||
| @@ -84,12 +91,12 @@ public class MallUserInfo implements Serializable { | |||||
| this.menus = menus; | this.menus = menus; | ||||
| } | } | ||||
| public Long getRoleId() { | |||||
| return roleId; | |||||
| public String getRoleName() { | |||||
| return roleName; | |||||
| } | } | ||||
| public void setRoleId(Long roleId) { | |||||
| this.roleId = roleId; | |||||
| public void setRoleName(String roleName) { | |||||
| this.roleName = roleName; | |||||
| } | } | ||||
| public String getTenantId() { | public String getTenantId() { | ||||
| @@ -156,6 +163,24 @@ public class MallUserInfo implements Serializable { | |||||
| this.permission = permission; | this.permission = permission; | ||||
| } | } | ||||
| public String getNickName() { | |||||
| return nickName; | |||||
| } | |||||
| public void setNickName(String nickName) { | |||||
| this.nickName = nickName; | |||||
| } | |||||
| public Long getRoleId() { | |||||
| return roleId; | |||||
| } | |||||
| public void setRoleId(Long roleId) { | |||||
| this.roleId = roleId; | |||||
| } | |||||
| public static enum Field | public static enum Field | ||||
| @@ -20,6 +20,9 @@ public class WxCoupon implements Serializable { | |||||
| protected List<Long> ids; | protected List<Long> ids; | ||||
| @Transient | @Transient | ||||
| protected String sortColumns; | protected String sortColumns; | ||||
| @Transient | |||||
| protected String channels; | |||||
| public Long getId() { | public Long getId() { | ||||
| return id; | return id; | ||||
| @@ -84,12 +87,6 @@ public class WxCoupon implements Serializable { | |||||
| /*1.主动领取2.定向投放**/ | /*1.主动领取2.定向投放**/ | ||||
| @io.swagger.annotations.ApiModelProperty(value="1.主动领取2.定向投放",name="sendType") | @io.swagger.annotations.ApiModelProperty(value="1.主动领取2.定向投放",name="sendType") | ||||
| private Integer 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)**/ | /*有效时间类型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") | @io.swagger.annotations.ApiModelProperty(value="有效时间类型1.时间范围(valid_start_date,valid_end_date). 2领取后几日有效(valid_days)",name="validType") | ||||
| private Integer validType; | private Integer validType; | ||||
| @@ -195,18 +192,6 @@ public class WxCoupon implements Serializable { | |||||
| public void setSendType(Integer _sendType) { | public void setSendType(Integer _sendType) { | ||||
| sendType = _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() { | public Integer getValidType() { | ||||
| return validType; | return validType; | ||||
| } | } | ||||
| @@ -321,6 +306,13 @@ public class WxCoupon implements Serializable { | |||||
| this.priceStr = priceStr; | this.priceStr = priceStr; | ||||
| } | } | ||||
| public String getChannels() { | |||||
| return channels; | |||||
| } | |||||
| public void setChannels(String channels) { | |||||
| this.channels = channels; | |||||
| } | |||||
| public static enum Field | public static enum Field | ||||
| @@ -19,6 +19,12 @@ public class WxCouponActionLog implements Serializable { | |||||
| protected List<Long> ids; | protected List<Long> ids; | ||||
| @Transient | @Transient | ||||
| protected String sortColumns; | protected String sortColumns; | ||||
| @Transient | |||||
| protected Date startTime; | |||||
| @Transient | |||||
| protected Date endTime; | |||||
| public Long getId() { | public Long getId() { | ||||
| return id; | return id; | ||||
| @@ -40,6 +46,22 @@ public class WxCouponActionLog implements Serializable { | |||||
| this.ids = ids; | this.ids = ids; | ||||
| } | } | ||||
| public Date getStartTime() { | |||||
| return startTime; | |||||
| } | |||||
| public void setStartTime(Date startTime) { | |||||
| this.startTime = startTime; | |||||
| } | |||||
| public Date getEndTime() { | |||||
| return endTime; | |||||
| } | |||||
| public void setEndTime(Date endTime) { | |||||
| this.endTime = endTime; | |||||
| } | |||||
| /*租户ID**/ | /*租户ID**/ | ||||
| @@ -11,16 +11,18 @@ import java.io.Serializable; | |||||
| @Table(name = "wx_coupon_channel") | @Table(name = "wx_coupon_channel") | ||||
| public class WxCouponChannel implements Serializable { | public class WxCouponChannel implements Serializable { | ||||
| private static final long serialVersionUID = 1L; | private static final long serialVersionUID = 1L; | ||||
| @Id | @Id | ||||
| protected Long id; | |||||
| @Transient | |||||
| protected List<String> ids; | |||||
| @Transient | |||||
| protected String sortColumns; | |||||
| protected Long id; | |||||
| @Transient | |||||
| protected List<Long> ids; | |||||
| @Transient | |||||
| protected List<Long> couponIds; | |||||
| @Transient | |||||
| protected String sortColumns; | |||||
| public Long getId() { | public Long getId() { | ||||
| return id; | return id; | ||||
| } | } | ||||
| @@ -28,30 +30,20 @@ public class WxCouponChannel implements Serializable { | |||||
| public void setId(Long id) { | public void setId(Long id) { | ||||
| this.id = id; | this.id = id; | ||||
| } | } | ||||
| public String getSortColumns() { | public String getSortColumns() { | ||||
| return sortColumns; | return sortColumns; | ||||
| } | } | ||||
| public List<String> getIds() { | |||||
| public List<Long> getIds() { | |||||
| return ids; | return ids; | ||||
| } | } | ||||
| public void setIds(List<String> ids) { | |||||
| public void setIds(List<Long> ids) { | |||||
| this.ids = ids; | this.ids = ids; | ||||
| } | } | ||||
| /***/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="",name="business") | |||||
| private String business; | |||||
| public String getBusiness() { | |||||
| return business; | |||||
| } | |||||
| public void setBusiness(String business) { | |||||
| this.business = business; | |||||
| } | |||||
| /*租户ID**/ | /*租户ID**/ | ||||
| @io.swagger.annotations.ApiModelProperty(value="租户ID",name="tenantId") | @io.swagger.annotations.ApiModelProperty(value="租户ID",name="tenantId") | ||||
| @@ -62,9 +54,7 @@ public class WxCouponChannel implements Serializable { | |||||
| /*卡券id**/ | /*卡券id**/ | ||||
| @io.swagger.annotations.ApiModelProperty(value="卡券id",name="couponId") | @io.swagger.annotations.ApiModelProperty(value="卡券id",name="couponId") | ||||
| private Long couponId; | private Long couponId; | ||||
| /*券状态,判断是否在前端展示**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="券状态,判断是否在前端展示",name="couponStatus") | |||||
| private Integer couponStatus; | |||||
| /*券类型(1.满减券,2.代金券,3.团购券,4.礼品券,5.停车券)**/ | /*券类型(1.满减券,2.代金券,3.团购券,4.礼品券,5.停车券)**/ | ||||
| @io.swagger.annotations.ApiModelProperty(value="券类型(1.满减券,2.代金券,3.团购券,4.礼品券,5.停车券)",name="type") | @io.swagger.annotations.ApiModelProperty(value="券类型(1.满减券,2.代金券,3.团购券,4.礼品券,5.停车券)",name="type") | ||||
| private Integer type; | private Integer type; | ||||
| @@ -74,6 +64,18 @@ public class WxCouponChannel implements Serializable { | |||||
| /*投放频道位置(1.列表, 2.限时抢购)**/ | /*投放频道位置(1.列表, 2.限时抢购)**/ | ||||
| @io.swagger.annotations.ApiModelProperty(value="投放频道位置(1.列表, 2.限时抢购)",name="targetAd") | @io.swagger.annotations.ApiModelProperty(value="投放频道位置(1.列表, 2.限时抢购)",name="targetAd") | ||||
| private Integer targetAd; | private Integer targetAd; | ||||
| /***/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="",name="business") | |||||
| private String business; | |||||
| /*开始时间**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="开始时间",name="beginTime") | |||||
| private Date beginTime; | |||||
| /*结束时间**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="结束时间",name="endTime") | |||||
| private Date endTime; | |||||
| /*0:上架 1:下架**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="0:上架 1:下架",name="status") | |||||
| private Integer status; | |||||
| /*创建时间**/ | /*创建时间**/ | ||||
| @io.swagger.annotations.ApiModelProperty(value="创建时间",name="createDate") | @io.swagger.annotations.ApiModelProperty(value="创建时间",name="createDate") | ||||
| private Date createDate; | private Date createDate; | ||||
| @@ -98,12 +100,6 @@ public class WxCouponChannel implements Serializable { | |||||
| public void setCouponId(Long _couponId) { | public void setCouponId(Long _couponId) { | ||||
| couponId = _couponId; | couponId = _couponId; | ||||
| } | } | ||||
| public Integer getCouponStatus() { | |||||
| return couponStatus; | |||||
| } | |||||
| public void setCouponStatus(Integer _couponStatus) { | |||||
| couponStatus = _couponStatus; | |||||
| } | |||||
| public Integer getType() { | public Integer getType() { | ||||
| return type; | return type; | ||||
| } | } | ||||
| @@ -122,6 +118,30 @@ public class WxCouponChannel implements Serializable { | |||||
| public void setTargetAd(Integer _targetAd) { | public void setTargetAd(Integer _targetAd) { | ||||
| targetAd = _targetAd; | targetAd = _targetAd; | ||||
| } | } | ||||
| public String getBusiness() { | |||||
| return business; | |||||
| } | |||||
| public void setBusiness(String _business) { | |||||
| business = _business; | |||||
| } | |||||
| public Date getBeginTime() { | |||||
| return beginTime; | |||||
| } | |||||
| public void setBeginTime(Date _beginTime) { | |||||
| beginTime = _beginTime; | |||||
| } | |||||
| public Date getEndTime() { | |||||
| return endTime; | |||||
| } | |||||
| public void setEndTime(Date _endTime) { | |||||
| endTime = _endTime; | |||||
| } | |||||
| public Integer getStatus() { | |||||
| return status; | |||||
| } | |||||
| public void setStatus(Integer _status) { | |||||
| status = _status; | |||||
| } | |||||
| public Date getCreateDate() { | public Date getCreateDate() { | ||||
| return createDate; | return createDate; | ||||
| } | } | ||||
| @@ -134,21 +154,33 @@ public class WxCouponChannel implements Serializable { | |||||
| public void setUpdateDate(Date _updateDate) { | public void setUpdateDate(Date _updateDate) { | ||||
| updateDate = _updateDate; | updateDate = _updateDate; | ||||
| } | } | ||||
| public List<Long> getCouponIds() { | |||||
| return couponIds; | |||||
| } | |||||
| public void setCouponIds(List<Long> couponIds) { | |||||
| this.couponIds = couponIds; | |||||
| } | |||||
| public static enum Field | public static enum Field | ||||
| { | { | ||||
| Id_ASC("`id` ASC"),Id_DESC("`id` DESC") | Id_ASC("`id` ASC"),Id_DESC("`id` DESC") | ||||
| ,TenantId_ASC("`tenantId` ASC"),TenantId_DESC("`tenantId` DESC") | |||||
| ,MerchantId_ASC("`merchantId` ASC"),MerchantId_DESC("`merchantId` DESC") | |||||
| ,CouponId_ASC("`couponId` ASC"),CouponId_DESC("`couponId` DESC") | |||||
| ,CouponStatus_ASC("`couponStatus` ASC"),CouponStatus_DESC("`couponStatus` DESC") | |||||
| ,Type_ASC("`type` ASC"),Type_DESC("`type` DESC") | |||||
| ,Title_ASC("`title` ASC"),Title_DESC("`title` DESC") | |||||
| ,TargetAd_ASC("`targetAd` ASC"),TargetAd_DESC("`targetAd` DESC") | |||||
| ,CreateDate_ASC("`createDate` ASC"),CreateDate_DESC("`createDate` DESC") | |||||
| ,UpdateDate_ASC("`updateDate` ASC"),UpdateDate_DESC("`updateDate` DESC") | |||||
| ; | |||||
| ,TenantId_ASC("`tenantId` ASC"),TenantId_DESC("`tenantId` DESC") | |||||
| ,MerchantId_ASC("`merchantId` ASC"),MerchantId_DESC("`merchantId` DESC") | |||||
| ,CouponId_ASC("`couponId` ASC"),CouponId_DESC("`couponId` DESC") | |||||
| ,CouponStatus_ASC("`couponStatus` ASC"),CouponStatus_DESC("`couponStatus` DESC") | |||||
| ,Type_ASC("`type` ASC"),Type_DESC("`type` DESC") | |||||
| ,Title_ASC("`title` ASC"),Title_DESC("`title` DESC") | |||||
| ,TargetAd_ASC("`targetAd` ASC"),TargetAd_DESC("`targetAd` DESC") | |||||
| ,Business_ASC("`business` ASC"),Business_DESC("`business` DESC") | |||||
| ,BeginTime_ASC("`beginTime` ASC"),BeginTime_DESC("`beginTime` DESC") | |||||
| ,EndTime_ASC("`endTime` ASC"),EndTime_DESC("`endTime` 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") | |||||
| ; | |||||
| private String value; | private String value; | ||||
| Field(String value){ | Field(String value){ | ||||
| this.value = value; | this.value = value; | ||||
| @@ -164,8 +196,8 @@ public class WxCouponChannel implements Serializable { | |||||
| return this.getValue(); | return this.getValue(); | ||||
| } | } | ||||
| } | } | ||||
| public void setSortColumns(Field... fields) | |||||
| public void setSortColumns(WxCouponChannel.Field... fields) | |||||
| { | { | ||||
| if (fields == null || fields.length == 0) { | if (fields == null || fields.length == 0) { | ||||
| return; | return; | ||||
| @@ -180,9 +212,9 @@ public class WxCouponChannel implements Serializable { | |||||
| sb.append(","); | sb.append(","); | ||||
| sb.append(fields[k].toString()); | sb.append(fields[k].toString()); | ||||
| } | } | ||||
| } | } | ||||
| public void setSortColumns(String sortColumns) | public void setSortColumns(String sortColumns) | ||||
| { | { | ||||
| if (sortColumns == null || "".equals(sortColumns.trim())) { | if (sortColumns == null || "".equals(sortColumns.trim())) { | ||||
| @@ -190,7 +222,7 @@ public class WxCouponChannel implements Serializable { | |||||
| } | } | ||||
| if (sortColumns.contains(",")) { | if (sortColumns.contains(",")) { | ||||
| String[] cols = sortColumns.split(","); | 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++) { | for (int k = 0; k < cols.length; k++) { | ||||
| fList.add(Field.valueOf(cols[k])); | fList.add(Field.valueOf(cols[k])); | ||||
| } | } | ||||
| @@ -0,0 +1,162 @@ | |||||
| 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_mall_config") | |||||
| public class WxMallConfig 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="key") | |||||
| private String key; | |||||
| /*0:启用 1:停用**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="0:启用 1:停用",name="value") | |||||
| private Integer value; | |||||
| /*备注**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="备注",name="remark") | |||||
| private String remark; | |||||
| /*创建时间**/ | |||||
| @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 String getKey() { | |||||
| return key; | |||||
| } | |||||
| public void setKey(String _key) { | |||||
| key = _key; | |||||
| } | |||||
| public Integer getValue() { | |||||
| return value; | |||||
| } | |||||
| public void setValue(Integer _value) { | |||||
| value = _value; | |||||
| } | |||||
| public String getRemark() { | |||||
| return remark; | |||||
| } | |||||
| public void setRemark(String _remark) { | |||||
| remark = _remark; | |||||
| } | |||||
| 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") | |||||
| ,Key_ASC("`key` ASC"),Key_DESC("`key` DESC") | |||||
| ,Value_ASC("`value` ASC"),Value_DESC("`value` DESC") | |||||
| ,Remark_ASC("`remark` ASC"),Remark_DESC("`remark` 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(WxMallConfig.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)); | |||||
| } | |||||
| } | |||||
| } | |||||
| @@ -45,6 +45,9 @@ public class WxPark implements Serializable { | |||||
| /*租户ID**/ | /*租户ID**/ | ||||
| @io.swagger.annotations.ApiModelProperty(value="租户ID",name="tenantId") | @io.swagger.annotations.ApiModelProperty(value="租户ID",name="tenantId") | ||||
| private String tenantId; | private String tenantId; | ||||
| /*停车场图片**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="停车场图片",name="imgUrl") | |||||
| private String imgUrl; | |||||
| /*停车场地址**/ | /*停车场地址**/ | ||||
| @io.swagger.annotations.ApiModelProperty(value="停车场地址",name="addr") | @io.swagger.annotations.ApiModelProperty(value="停车场地址",name="addr") | ||||
| private String addr; | private String addr; | ||||
| @@ -78,6 +81,15 @@ public class WxPark implements Serializable { | |||||
| public void setTenantId(String _tenantId) { | public void setTenantId(String _tenantId) { | ||||
| tenantId = _tenantId; | tenantId = _tenantId; | ||||
| } | } | ||||
| public String getImgUrl() { | |||||
| return imgUrl; | |||||
| } | |||||
| public void setImgUrl(String imgUrl) { | |||||
| this.imgUrl = imgUrl; | |||||
| } | |||||
| public String getAddr() { | public String getAddr() { | ||||
| return addr; | return addr; | ||||
| } | } | ||||
| @@ -140,6 +152,7 @@ public class WxPark implements Serializable { | |||||
| { | { | ||||
| Id_ASC("`id` ASC"),Id_DESC("`id` DESC") | Id_ASC("`id` ASC"),Id_DESC("`id` DESC") | ||||
| ,TenantId_ASC("`tenantId` ASC"),TenantId_DESC("`tenantId` DESC") | ,TenantId_ASC("`tenantId` ASC"),TenantId_DESC("`tenantId` DESC") | ||||
| ,ImgUrl_ASC("`imgUrl` ASC"),ImgUrl_DESC("`imgUrl` DESC") | |||||
| ,Addr_ASC("`addr` ASC"),Addr_DESC("`addr` DESC") | ,Addr_ASC("`addr` ASC"),Addr_DESC("`addr` DESC") | ||||
| ,Number_ASC("`number` ASC"),Number_DESC("`number` DESC") | ,Number_ASC("`number` ASC"),Number_DESC("`number` DESC") | ||||
| ,EntryExit_ASC("`entryExit` ASC"),EntryExit_DESC("`entryExit` DESC") | ,EntryExit_ASC("`entryExit` ASC"),EntryExit_DESC("`entryExit` DESC") | ||||
| @@ -16,78 +16,48 @@ public class AmountRecordVo implements Serializable{ | |||||
| * | * | ||||
| */ | */ | ||||
| private static final long serialVersionUID = 4494858079134918638L; | private static final long serialVersionUID = 4494858079134918638L; | ||||
| //交易金额记录 | |||||
| private List<WxDateAmountRecord> orderAmountList; | |||||
| //核销金额记录 | //核销金额记录 | ||||
| private List<WxDateAmountRecord> verifyAmountList; | |||||
| private WxDateAmountRecord amountDetail; | |||||
| private Integer orderAmount; | |||||
| private Integer amount; | |||||
| private String orderAmountStr; | |||||
| private Integer verifyAmount; | |||||
| private String verifyAmountStr; | |||||
| private String amountStr; | |||||
| public String getOrderAmountStr() { | |||||
| if(orderAmount!=null) { | |||||
| DecimalFormat df=new DecimalFormat("0.00"); | |||||
| orderAmountStr = df.format((float)orderAmount/100); | |||||
| } | |||||
| return orderAmountStr; | |||||
| } | |||||
| private String mouthAndDate; | |||||
| public String getVerifyAmountStr() { | |||||
| if(verifyAmount!=null) { | |||||
| public String getAmountStr() { | |||||
| if(amount!=null) { | |||||
| DecimalFormat df=new DecimalFormat("0.00"); | DecimalFormat df=new DecimalFormat("0.00"); | ||||
| verifyAmountStr = df.format((float)verifyAmount/100); | |||||
| amountStr = df.format((float)amount/100); | |||||
| } | } | ||||
| return verifyAmountStr; | |||||
| return amountStr; | |||||
| } | } | ||||
| public Integer getOrderAmount() { | |||||
| return orderAmount; | |||||
| public void setMouthAndDate(String mouthAndDate) { | |||||
| this.mouthAndDate = mouthAndDate; | |||||
| } | } | ||||
| public void setOrderAmount(Integer orderAmount) { | |||||
| this.orderAmount = orderAmount; | |||||
| } | |||||
| public String getMouthAndDate() {return mouthAndDate;} | |||||
| public Integer getVerifyAmount() { | |||||
| return verifyAmount; | |||||
| public void setAmountStr(String amountStr) { | |||||
| this.amountStr = amountStr; | |||||
| } | } | ||||
| public void setVerifyAmount(Integer verifyAmount) { | |||||
| this.verifyAmount = verifyAmount; | |||||
| } | |||||
| public void setOrderAmountStr(String orderAmountStr) { | |||||
| this.orderAmountStr = orderAmountStr; | |||||
| public Integer getAmount() { | |||||
| return amount; | |||||
| } | } | ||||
| public void setVerifyAmountStr(String verifyAmountStr) { | |||||
| this.verifyAmountStr = verifyAmountStr; | |||||
| } | |||||
| public void setAmount(Integer amount) {this.amount = amount;} | |||||
| public List<WxDateAmountRecord> getOrderAmountList() { | |||||
| return orderAmountList; | |||||
| public WxDateAmountRecord getAmountDetail() { | |||||
| return amountDetail; | |||||
| } | } | ||||
| public void setOrderAmountList(List<WxDateAmountRecord> orderAmountList) { | |||||
| this.orderAmountList = orderAmountList; | |||||
| public void setAmountDetail(WxDateAmountRecord amountDetail) { | |||||
| this.amountDetail = amountDetail; | |||||
| } | } | ||||
| public List<WxDateAmountRecord> getVerifyAmountList() { | |||||
| return verifyAmountList; | |||||
| } | |||||
| public void setVerifyAmountList(List<WxDateAmountRecord> verifyAmountList) { | |||||
| this.verifyAmountList = verifyAmountList; | |||||
| } | |||||
| } | } | ||||
| @@ -1,96 +0,0 @@ | |||||
| package com.simple.domain.vo; | |||||
| import java.io.Serializable; | |||||
| public class OrderVo 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="merchantId") | |||||
| private Long merchantId; | |||||
| /*订单ID**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="订单ID",name="orderId") | |||||
| private Long orderId; | |||||
| /*卡券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; | |||||
| /*订单状态**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="订单状态",name="orderStatus") | |||||
| private Integer orderStatus; | |||||
| /*券状态**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="券状态",name="status") | |||||
| private Integer couponStatus; | |||||
| public String getTenantId() { | |||||
| return tenantId; | |||||
| } | |||||
| public void setTenantId(String tenantId) { | |||||
| this.tenantId = tenantId; | |||||
| } | |||||
| public Long getMerchantId() { | |||||
| return merchantId; | |||||
| } | |||||
| public void setMerchantId(Long merchantId) { | |||||
| this.merchantId = merchantId; | |||||
| } | |||||
| public Long getOrderId() { | |||||
| return orderId; | |||||
| } | |||||
| public void setOrderId(Long orderId) { | |||||
| this.orderId = orderId; | |||||
| } | |||||
| public Long getCouponId() { | |||||
| return couponId; | |||||
| } | |||||
| public void setCouponId(Long couponId) { | |||||
| this.couponId = couponId; | |||||
| } | |||||
| public Long getcUserId() { | |||||
| return cUserId; | |||||
| } | |||||
| public void setcUserId(Long cUserId) { | |||||
| this.cUserId = cUserId; | |||||
| } | |||||
| public Long getbUserId() { | |||||
| return bUserId; | |||||
| } | |||||
| public void setbUserId(Long bUserId) { | |||||
| this.bUserId = bUserId; | |||||
| } | |||||
| public Integer getOrderStatus() { | |||||
| return orderStatus; | |||||
| } | |||||
| public void setOrderStatus(Integer orderStatus) { | |||||
| this.orderStatus = orderStatus; | |||||
| } | |||||
| public Integer getCouponStatus() { | |||||
| return couponStatus; | |||||
| } | |||||
| public void setCouponStatus(Integer couponStatus) { | |||||
| this.couponStatus = couponStatus; | |||||
| } | |||||
| } | |||||
| @@ -0,0 +1,50 @@ | |||||
| package com.simple.domain.vo; | |||||
| import java.io.Serializable; | |||||
| /** | |||||
| * 会员结构vo | |||||
| * @author jinguo | |||||
| * | |||||
| */ | |||||
| public class UserStructureVo implements Serializable{ | |||||
| /** | |||||
| * | |||||
| */ | |||||
| private static final long serialVersionUID = 6780570955120276660L; | |||||
| //名称 | |||||
| private String name; | |||||
| //数量 | |||||
| private String count; | |||||
| //百分比 | |||||
| private String percentage; | |||||
| //序号 | |||||
| private Integer sortNum; | |||||
| public Integer getSortNum() { | |||||
| return sortNum; | |||||
| } | |||||
| public void setSortNum(Integer sortNum) { | |||||
| this.sortNum = sortNum; | |||||
| } | |||||
| public String getName() { | |||||
| return name; | |||||
| } | |||||
| public void setName(String name) { | |||||
| this.name = name; | |||||
| } | |||||
| public String getCount() { | |||||
| return count; | |||||
| } | |||||
| public void setCount(String count) { | |||||
| this.count = count; | |||||
| } | |||||
| public String getPercentage() { | |||||
| return percentage; | |||||
| } | |||||
| public void setPercentage(String percentage) { | |||||
| this.percentage = percentage; | |||||
| } | |||||
| } | |||||
| @@ -12,6 +12,7 @@ import java.util.List; | |||||
| public class WxCouponCVo implements Serializable { | public class WxCouponCVo implements Serializable { | ||||
| private static final long serialVersionUID = 1L; | private static final long serialVersionUID = 1L; | ||||
| /*投放券频道id**/ | |||||
| @Id | @Id | ||||
| protected Long id; | protected Long id; | ||||
| @@ -50,6 +51,20 @@ public class WxCouponCVo implements Serializable { | |||||
| @Transient | @Transient | ||||
| private String priceStr; | private String priceStr; | ||||
| /*发放相关参数*/ | |||||
| /*卡券id**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="卡券id",name="couponId") | |||||
| private Long couponId; | |||||
| /*开始时间**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="开始时间",name="beginTime") | |||||
| private Date beginTime; | |||||
| /*结束时间**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="结束时间",name="endTime") | |||||
| private Date endTime; | |||||
| /*租户ID**/ | /*租户ID**/ | ||||
| @io.swagger.annotations.ApiModelProperty(value="租户ID",name="tenantId") | @io.swagger.annotations.ApiModelProperty(value="租户ID",name="tenantId") | ||||
| private String tenantId; | private String tenantId; | ||||
| @@ -162,6 +177,24 @@ public class WxCouponCVo implements Serializable { | |||||
| private String floorName; | private String floorName; | ||||
| public Date getBeginTime() { | |||||
| return beginTime; | |||||
| } | |||||
| public void setBeginTime(Date _beginTime) { | |||||
| beginTime = _beginTime; | |||||
| } | |||||
| public Date getEndTime() { | |||||
| return endTime; | |||||
| } | |||||
| public void setEndTime(Date _endTime) { | |||||
| endTime = _endTime; | |||||
| } | |||||
| public Long getCouponId() { | |||||
| return couponId; | |||||
| } | |||||
| public void setCouponId(Long _couponId) { | |||||
| couponId = _couponId; | |||||
| } | |||||
| public String getTenantId() { | public String getTenantId() { | ||||
| return tenantId; | return tenantId; | ||||
| @@ -415,6 +448,7 @@ public class WxCouponCVo implements Serializable { | |||||
| public static enum Field | public static enum Field | ||||
| { | { | ||||
| Id_ASC("`id` ASC"),Id_DESC("`id` DESC") | Id_ASC("`id` ASC"),Id_DESC("`id` DESC") | ||||
| ,CouponChannelId_ASC("`couponChannelId` ASC"),CouponChannelId_DESC("`couponChannelId` DESC") | |||||
| ,TenantId_ASC("`tenantId` ASC"),TenantId_DESC("`tenantId` DESC") | ,TenantId_ASC("`tenantId` ASC"),TenantId_DESC("`tenantId` DESC") | ||||
| ,MerchantId_ASC("`merchantId` ASC"),MerchantId_DESC("`merchantId` DESC") | ,MerchantId_ASC("`merchantId` ASC"),MerchantId_DESC("`merchantId` DESC") | ||||
| ,Type_ASC("`type` ASC"),Type_DESC("`type` DESC") | ,Type_ASC("`type` ASC"),Type_DESC("`type` DESC") | ||||
| @@ -13,11 +13,20 @@ import java.util.Date; | |||||
| */ | */ | ||||
| public class WxCouponChannelVo extends WxCouponChannel implements Serializable { | public class WxCouponChannelVo extends WxCouponChannel implements Serializable { | ||||
| private static final long serialVersionUID = 1L; | private static final long serialVersionUID = 1L; | ||||
| /*剩余库存**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="剩余库存",name="remainInventory") | @io.swagger.annotations.ApiModelProperty(value="剩余库存",name="remainInventory") | ||||
| private Integer remainInventory; | private Integer remainInventory; | ||||
| /*封面图**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="封面图",name="coverImg") | @io.swagger.annotations.ApiModelProperty(value="封面图",name="coverImg") | ||||
| private String coverImg; | private String coverImg; | ||||
| /*券名称**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="券名称",name="title") | |||||
| private String title; | |||||
| /*副标题**/ | /*副标题**/ | ||||
| @io.swagger.annotations.ApiModelProperty(value="副标题",name="subTitle") | @io.swagger.annotations.ApiModelProperty(value="副标题",name="subTitle") | ||||
| private String subTitle; | private String subTitle; | ||||
| @@ -31,6 +40,9 @@ public class WxCouponChannelVo extends WxCouponChannel implements Serializable { | |||||
| @io.swagger.annotations.ApiModelProperty(value="面额",name="price") | @io.swagger.annotations.ApiModelProperty(value="面额",name="price") | ||||
| private Integer price; | private Integer price; | ||||
| /*券类型(1.满减券,2.代金券,3.团购券,4.礼品券,5.停车券)**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="券类型(1.满减券,2.代金券,3.团购券,4.礼品券,5.停车券)",name="type") | |||||
| private Integer type; | |||||
| @Transient | @Transient | ||||
| private String salePriceStr; | private String salePriceStr; | ||||
| @@ -48,12 +60,6 @@ public class WxCouponChannelVo extends WxCouponChannel implements Serializable { | |||||
| /*1.主动领取2.定向投放**/ | /*1.主动领取2.定向投放**/ | ||||
| @io.swagger.annotations.ApiModelProperty(value="1.主动领取2.定向投放",name="sendType") | @io.swagger.annotations.ApiModelProperty(value="1.主动领取2.定向投放",name="sendType") | ||||
| private Integer sendType; | private Integer sendType; | ||||
| /*发放开始时间**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="发放开始时间",name="sendStartDate") | |||||
| private Date sendStartDate; | |||||
| /*发放结束时间**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="发放结束时间",name="sendEndDate") | |||||
| private Date sendEndDate; | |||||
| public Integer getRemainInventory() { | public Integer getRemainInventory() { | ||||
| return remainInventory; | return remainInventory; | ||||
| @@ -119,22 +125,6 @@ public class WxCouponChannelVo extends WxCouponChannel implements Serializable { | |||||
| this.sendType = sendType; | this.sendType = sendType; | ||||
| } | } | ||||
| public Date getSendStartDate() { | |||||
| return sendStartDate; | |||||
| } | |||||
| public void setSendStartDate(Date sendStartDate) { | |||||
| this.sendStartDate = sendStartDate; | |||||
| } | |||||
| public Date getSendEndDate() { | |||||
| return sendEndDate; | |||||
| } | |||||
| public void setSendEndDate(Date sendEndDate) { | |||||
| this.sendEndDate = sendEndDate; | |||||
| } | |||||
| public String getSalePriceStr() { | public String getSalePriceStr() { | ||||
| if(salePrice!=null) { | if(salePrice!=null) { | ||||
| DecimalFormat df=new DecimalFormat("0.00"); | DecimalFormat df=new DecimalFormat("0.00"); | ||||
| @@ -178,12 +168,12 @@ public class WxCouponChannelVo extends WxCouponChannel implements Serializable { | |||||
| this.remainInventory=wxCoupon.getRemainInventory(); | this.remainInventory=wxCoupon.getRemainInventory(); | ||||
| this.price=wxCoupon.getPrice(); | this.price=wxCoupon.getPrice(); | ||||
| this.salePrice=wxCoupon.getSalePrice(); | this.salePrice=wxCoupon.getSalePrice(); | ||||
| this.sendStartDate=wxCoupon.getSendStartDate(); | |||||
| this.sendEndDate=wxCoupon.getSendEndDate(); | |||||
| this.sendType=wxCoupon.getSendType(); | this.sendType=wxCoupon.getSendType(); | ||||
| this.useLimitQuantity=wxCoupon.getUseLimitQuantity(); | this.useLimitQuantity=wxCoupon.getUseLimitQuantity(); | ||||
| this.usePrice=wxCoupon.getUsePrice(); | this.usePrice=wxCoupon.getUsePrice(); | ||||
| this.subTitle=wxCoupon.getSubTitle(); | this.subTitle=wxCoupon.getSubTitle(); | ||||
| this.title=wxCoupon.getSubTitle(); | |||||
| this.type=wxCoupon.getType(); | |||||
| return this; | return this; | ||||
| } | } | ||||
| @@ -0,0 +1,404 @@ | |||||
| package com.simple.domain.vo; | |||||
| import com.simple.domain.po.WxCouponOrder; | |||||
| import com.simple.domain.po.WxOrder; | |||||
| import javax.persistence.Id; | |||||
| import javax.persistence.Transient; | |||||
| import java.util.Date; | |||||
| import java.util.List; | |||||
| public class WxOrderCVo 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="orderNumber") | |||||
| private Long orderNumber; | |||||
| /*租户ID**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="租户ID",name="tenantId") | |||||
| private String tenantId; | |||||
| /*c端用户id**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="c端用户id",name="cUserId") | |||||
| private Long cUserId; | |||||
| /*商户ID**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="商户ID",name="merchantId") | |||||
| private Long merchantId; | |||||
| /*操作券B端小程序用户ID**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="操作券B端小程序用户ID",name="bUserId") | |||||
| private Long bUserId; | |||||
| /*券ID-产品ID将来的产品都会放在coupon表里**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="券ID",name="couponId") | |||||
| private Long couponId; | |||||
| /*0: 付款 1: 退款**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="0: 付款 1: 退款",name="paymentType") | |||||
| private Integer paymentType; | |||||
| /*支付金额(分):允许有负数,退款时为负值。**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="支付金额(分):允许有负数,退款时为负值。",name="payment") | |||||
| private Integer payment; | |||||
| /*支付时间**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="支付时间",name="paymentTime") | |||||
| private Date paymentTime; | |||||
| /*订单状态:-1全部;正向交易:0-已下单/待付款;1-已支付;2-已取消(限定时间内未付款)反向交易:3-已退款;4-退款失败**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="订单状态:-1全部;正向交易:0-已下单/待付款;1-已支付;2-已取消(限定时间内未付款)反向交易:3-已退款;4-退款失败",name="orderStatus") | |||||
| private Integer orderStatus; | |||||
| /*创建时间**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="创建时间",name="createDate") | |||||
| private Date createDate; | |||||
| /*更新时间**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="更新时间",name="updateDate") | |||||
| private Date updateDate; | |||||
| /* 券类型信息 */ | |||||
| /*商户id**/ | |||||
| /*券类型(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 Long getOrderNumber() { | |||||
| return orderNumber; | |||||
| } | |||||
| public void setOrderNumber(Long _orderNumber) { | |||||
| orderNumber = _orderNumber; | |||||
| } | |||||
| public String getTenantId() { | |||||
| return tenantId; | |||||
| } | |||||
| public void setTenantId(String _tenantId) { | |||||
| tenantId = _tenantId; | |||||
| } | |||||
| public Long getCUserId() { | |||||
| return cUserId; | |||||
| } | |||||
| public void setCUserId(Long _cUserId) { | |||||
| cUserId = _cUserId; | |||||
| } | |||||
| public Long getMerchantId() { | |||||
| return merchantId; | |||||
| } | |||||
| public void setMerchantId(Long _merchantId) { | |||||
| merchantId = _merchantId; | |||||
| } | |||||
| public Long getBUserId() { | |||||
| return bUserId; | |||||
| } | |||||
| public void setBUserId(Long _bUserId) { | |||||
| bUserId = _bUserId; | |||||
| } | |||||
| public Long getCouponId() { | |||||
| return couponId; | |||||
| } | |||||
| public void setCouponId(Long _couponId) { | |||||
| this.couponId = _couponId; | |||||
| } | |||||
| public Integer getPaymentType() { | |||||
| return paymentType; | |||||
| } | |||||
| public void setPaymentType(Integer _paymentType) { | |||||
| paymentType = _paymentType; | |||||
| } | |||||
| public Integer getPayment() { | |||||
| return payment; | |||||
| } | |||||
| public void setPayment(Integer _payment) { | |||||
| payment = _payment; | |||||
| } | |||||
| public Date getPaymentTime() { | |||||
| return paymentTime; | |||||
| } | |||||
| public void setPaymentTime(Date _paymentTime) { | |||||
| paymentTime = _paymentTime; | |||||
| } | |||||
| public Integer getOrderStatus() { | |||||
| return orderStatus; | |||||
| } | |||||
| public void setOrderStatus(Integer _orderStatus) { | |||||
| orderStatus = _orderStatus; | |||||
| } | |||||
| 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 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") | |||||
| ,OrderNumber_ASC("`orderNumber` ASC"),OrderNumber_DESC("`orderNumber` DESC") | |||||
| ,TenantId_ASC("`tenantId` ASC"),TenantId_DESC("`tenantId` DESC") | |||||
| ,CUserId_ASC("`cUserId` ASC"),CUserId_DESC("`cUserId` DESC") | |||||
| ,MerchantId_ASC("`merchantId` ASC"),MerchantId_DESC("`merchantId` DESC") | |||||
| ,BUserId_ASC("`bUserId` ASC"),BUserId_DESC("`bUserId` DESC") | |||||
| ,CouponId_ASC("`couponId` ASC"),CouponId_DESC("`couponId` DESC") | |||||
| ,PaymentType_ASC("`paymentType` ASC"),PaymentType_DESC("`paymentType` DESC") | |||||
| ,Payment_ASC("`payment` ASC"),Payment_DESC("`payment` DESC") | |||||
| ,PaymentTime_ASC("`paymentTime` ASC"),PaymentTime_DESC("`paymentTime` DESC") | |||||
| ,OrderStatus_ASC("`orderStatus` ASC"),OrderStatus_DESC("`orderStatus` DESC") | |||||
| ,CreateDate_ASC("`createDate` ASC"),CreateDate_DESC("`createDate` DESC") | |||||
| ,UpdateDate_ASC("`updateDate` ASC"),UpdateDate_DESC("`updateDate` DESC") | |||||
| ,Detail_ASC("`detail` ASC"),Detail_DESC("`detail` 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(WxOrder.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<WxOrder.Field> fList = new java.util.ArrayList(); | |||||
| for (int k = 0; k < cols.length; k++) { | |||||
| fList.add(WxOrder.Field.valueOf(cols[k])); | |||||
| } | |||||
| this.setSortColumns(fList.toArray(new WxOrder.Field[fList.size()])); | |||||
| } else { | |||||
| this.setSortColumns(WxOrder.Field.valueOf(sortColumns)); | |||||
| } | |||||
| } | |||||
| } | |||||
| @@ -0,0 +1,59 @@ | |||||
| package com.simple.enums; | |||||
| public enum EnumAgeInfo { | |||||
| FIRST_SLOT(1,0,18,"18岁以下"), | |||||
| SECOND_SLOT(2,18,24,"18岁-24岁"), | |||||
| THIRD_SLOT(3,25,34,"25岁-34岁"), | |||||
| FOURTH_SLOT(4,35,44,"35岁-44岁"), | |||||
| FIFTH_SLOT(5,45,54,"45岁-54岁"), | |||||
| SIXTH_SLOT(6,54,60,"55岁-60岁"), | |||||
| SEVENTH_SLOT(7,60,200,"60岁以上") | |||||
| ; | |||||
| private EnumAgeInfo(Integer sortNum,Integer start,Integer end,String desc) { | |||||
| this.sortNum =sortNum; | |||||
| this.start=start; | |||||
| this.end = end; | |||||
| this.desc =desc; | |||||
| } | |||||
| private Integer sortNum; | |||||
| private Integer start; | |||||
| private Integer end; | |||||
| private String desc; | |||||
| public Integer getStart() { | |||||
| return start; | |||||
| } | |||||
| public void setStart(Integer start) { | |||||
| this.start = start; | |||||
| } | |||||
| public Integer getEnd() { | |||||
| return end; | |||||
| } | |||||
| public void setEnd(Integer end) { | |||||
| this.end = end; | |||||
| } | |||||
| public String getDesc() { | |||||
| return desc; | |||||
| } | |||||
| public void setDesc(String desc) { | |||||
| this.desc = desc; | |||||
| } | |||||
| public Integer getSortNum() { | |||||
| return sortNum; | |||||
| } | |||||
| public void setSortNum(Integer sortNum) { | |||||
| this.sortNum = sortNum; | |||||
| } | |||||
| } | |||||
| @@ -0,0 +1,38 @@ | |||||
| package com.simple.enums; | |||||
| /** | |||||
| * Created by Stormeye on 2018/08/09. | |||||
| */ | |||||
| public enum EnumCouponChannelStatus { | |||||
| // 0-草稿/待生效;1-已生效/已发布/已投放;2-已下架; | |||||
| STATUS_THROW_IN(0, "已上架"), | |||||
| STATUS_TAKE_OFFF(1, "已下架"), | |||||
| ; | |||||
| public static EnumCouponChannelStatus getEnum(Integer code) { | |||||
| for (EnumCouponChannelStatus value : values()) { | |||||
| if (value.getCode().equals(code)) { | |||||
| return value; | |||||
| } | |||||
| } | |||||
| return null; | |||||
| } | |||||
| private Integer code; | |||||
| private String message; | |||||
| EnumCouponChannelStatus(Integer code, String message) { | |||||
| this.code = code; | |||||
| this.message = message; | |||||
| } | |||||
| public Integer getCode() { | |||||
| return code; | |||||
| } | |||||
| public String getMessage() { | |||||
| return message; | |||||
| } | |||||
| } | |||||
| @@ -17,5 +17,7 @@ public interface WxCUserBasicInfoMapper extends CommonMapper<WxCUserBasicInfo, S | |||||
| void updateScore(WxCUserBasicInfo record); | void updateScore(WxCUserBasicInfo record); | ||||
| long findCountBySex(WxCuerBasicInfoDto dto); | |||||
| long findCountByAge(WxCuerBasicInfoDto dto); | |||||
| } | } | ||||
| @@ -1,8 +1,9 @@ | |||||
| package com.simple.mapper; | package com.simple.mapper; | ||||
| import java.util.*; | |||||
| import java.util.List; | |||||
| import com.simple.common.CommonMapper; | import com.simple.common.CommonMapper; | ||||
| import org.apache.ibatis.annotations.Param; | |||||
| import com.simple.domain.dto.WxCuerBasicInfoDto; | |||||
| import com.simple.domain.po.WxCUser; | import com.simple.domain.po.WxCUser; | ||||
| public interface WxCUserMapper extends CommonMapper<WxCUser, Long> { | public interface WxCUserMapper extends CommonMapper<WxCUser, Long> { | ||||
| @@ -13,4 +14,6 @@ public interface WxCUserMapper extends CommonMapper<WxCUser, Long> { | |||||
| WxCUser findByOpenId(WxCUser record); | WxCUser findByOpenId(WxCUser record); | ||||
| WxCUser findByToken(String token); | WxCUser findByToken(String token); | ||||
| long findCountBySex(WxCuerBasicInfoDto dto); | |||||
| } | } | ||||
| @@ -9,10 +9,8 @@ import org.apache.ibatis.annotations.Param; | |||||
| public interface WxCUserTagsMapper extends CommonMapper<WxCUserTags, String> { | public interface WxCUserTagsMapper extends CommonMapper<WxCUserTags, String> { | ||||
| List<WxCUserTags> findList(WxCUserTags wxCUserTags); | List<WxCUserTags> findList(WxCUserTags wxCUserTags); | ||||
| long findCountByTag(List<Long> tagIds); | |||||
| List<Long> findUserByTag(List<Long> tagIds); | |||||
| List<Long> findUserByTag(@Param("tagIds")String tagIds); | |||||
| long findCountByTags(@Param("tagIds")String tagIds); | long findCountByTags(@Param("tagIds")String tagIds); | ||||
| @@ -1,17 +1,17 @@ | |||||
| package com.simple.mapper; | package com.simple.mapper; | ||||
| import java.util.*; | |||||
| import com.simple.common.CommonMapper; | import com.simple.common.CommonMapper; | ||||
| import org.apache.ibatis.annotations.Param; | |||||
| import com.simple.domain.po.WxCarCmdLog; | import com.simple.domain.po.WxCarCmdLog; | ||||
| import java.util.HashMap; | |||||
| import java.util.List; | |||||
| import java.util.Map; | |||||
| public interface WxCarCmdLogMapper extends CommonMapper<WxCarCmdLog, Long> { | public interface WxCarCmdLogMapper extends CommonMapper<WxCarCmdLog, Long> { | ||||
| List<WxCarCmdLog> findList(WxCarCmdLog wxCarCmdLog); | List<WxCarCmdLog> findList(WxCarCmdLog wxCarCmdLog); | ||||
| List<Map<String,Object>> queryHistory(HashMap<Object,Object> params); | |||||
| List<Map<String, Object>> queryTodayCar(HashMap<Object,Object> params); | |||||
| } | } | ||||
| @@ -11,6 +11,8 @@ public interface WxCouponChannelMapper extends CommonMapper<WxCouponChannel, Str | |||||
| List<WxCouponChannel> findList(WxCouponChannel wxCouponChannel); | List<WxCouponChannel> findList(WxCouponChannel wxCouponChannel); | ||||
| List<WxCouponChannelVo> findVoList(WxCouponChannel wxCouponChannel); | List<WxCouponChannelVo> findVoList(WxCouponChannel wxCouponChannel); | ||||
| void updateStatusByCouponId(WxCouponChannel wxCouponChannel); | |||||
| @@ -2,6 +2,7 @@ package com.simple.mapper; | |||||
| import java.util.*; | import java.util.*; | ||||
| import com.simple.common.CommonMapper; | import com.simple.common.CommonMapper; | ||||
| import com.simple.domain.po.WxCouponChannel; | |||||
| import com.simple.domain.vo.WxCouponCVo; | import com.simple.domain.vo.WxCouponCVo; | ||||
| import org.apache.ibatis.annotations.Param; | import org.apache.ibatis.annotations.Param; | ||||
| import com.simple.domain.po.WxCoupon; | import com.simple.domain.po.WxCoupon; | ||||
| @@ -15,8 +16,6 @@ public interface WxCouponMapper extends CommonMapper<WxCoupon, Long> { | |||||
| List<WxCoupon> findCanSendList(WxCoupon wxCoupon); | List<WxCoupon> findCanSendList(WxCoupon wxCoupon); | ||||
| List<WxCouponCVo> findListForCUser(WxCoupon wxCoupon); | |||||
| WxCouponCVo selectDetailForCUser(WxCoupon wxCoupon); | |||||
| WxCouponCVo selectDetailForCUser(WxCouponChannel wxCouponChannel); | |||||
| } | } | ||||
| @@ -19,4 +19,6 @@ public interface WxCouponOrderMapper extends CommonMapper<WxCouponOrder, Long> { | |||||
| List<WxCouponOrderCVo> findListOfCUser(Map paramMap); | List<WxCouponOrderCVo> findListOfCUser(Map paramMap); | ||||
| WxCouponOrderCVo selectDetailOfCUser(Map paramMap); | WxCouponOrderCVo selectDetailOfCUser(Map paramMap); | ||||
| List<WxCouponOrderCVo> findListOfAdmin(WxCouponOrder wxCouponOrder); | |||||
| } | } | ||||
| @@ -8,6 +8,8 @@ import com.simple.domain.po.WxCouponSend; | |||||
| public interface WxCouponSendMapper extends CommonMapper<WxCouponSend, String> { | public interface WxCouponSendMapper extends CommonMapper<WxCouponSend, String> { | ||||
| List<WxCouponSend> findList(WxCouponSend wxCouponSend); | List<WxCouponSend> findList(WxCouponSend wxCouponSend); | ||||
| void updateStatusByCouponId(WxCouponSend wxCouponSend); | |||||
| @@ -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.WxMallConfig; | |||||
| public interface WxMallConfigMapper extends CommonMapper<WxMallConfig, Long> { | |||||
| List<WxMallConfig> findList(WxMallConfig wxMallConfig); | |||||
| } | |||||
| @@ -3,7 +3,7 @@ package com.simple.mapper; | |||||
| import java.util.*; | import java.util.*; | ||||
| import com.simple.common.CommonMapper; | import com.simple.common.CommonMapper; | ||||
| import com.simple.domain.po.WxCouponOrder; | import com.simple.domain.po.WxCouponOrder; | ||||
| import com.simple.domain.vo.OrderVo; | |||||
| import com.simple.domain.vo.WxOrderCVo; | |||||
| import org.apache.ibatis.annotations.Param; | import org.apache.ibatis.annotations.Param; | ||||
| import com.simple.domain.po.WxOrder; | import com.simple.domain.po.WxOrder; | ||||
| @@ -11,9 +11,9 @@ public interface WxOrderMapper extends CommonMapper<WxOrder, Long> { | |||||
| List<WxOrder> findList(WxOrder wxOrder); | List<WxOrder> findList(WxOrder wxOrder); | ||||
| List<Map<String,Object>> queryListMap(OrderVo orderVo); | |||||
| List<WxOrder> findListOfUnpaidOrderByDate(Map dateMap); | |||||
| Map<String,Object> queryObject(OrderVo orderVo); | |||||
| List<WxOrderCVo> findListOfCUser(WxOrder wxOrder); | |||||
| WxOrderCVo selectDetailOfCUser(WxOrder wxOrder); | |||||
| List<WxOrder> findListOfUnpaidOrderByDate(Map dateMap); | |||||
| } | } | ||||
| @@ -0,0 +1,65 @@ | |||||
| package com.simple.pay; | |||||
| /** | |||||
| * Created by Stormeye on 2018/8/10. | |||||
| */ | |||||
| public class WxPayOrderQ { | |||||
| private String appid; // 公众账号ID | |||||
| private String mch_id; // 商户号 | |||||
| private String nonce_str; // 随机字符串 | |||||
| private String sign; // 签名 | |||||
| private String out_trade_no; // 商户订单号 | |||||
| public String getAppid() { | |||||
| return appid; | |||||
| } | |||||
| public void setAppid(String appid) { | |||||
| this.appid = appid; | |||||
| } | |||||
| public String getMch_id() { | |||||
| return mch_id; | |||||
| } | |||||
| public void setMch_id(String mch_id) { | |||||
| this.mch_id = mch_id; | |||||
| } | |||||
| public String getNonce_str() { | |||||
| return nonce_str; | |||||
| } | |||||
| public void setNonce_str(String nonce_str) { | |||||
| this.nonce_str = nonce_str; | |||||
| } | |||||
| public String getSign() { | |||||
| return sign; | |||||
| } | |||||
| public void setSign(String sign) { | |||||
| this.sign = sign; | |||||
| } | |||||
| public String getOut_trade_no() { | |||||
| return out_trade_no; | |||||
| } | |||||
| public void setOut_trade_no(String out_trade_no) { | |||||
| this.out_trade_no = out_trade_no; | |||||
| } | |||||
| @Override | |||||
| public String toString() { | |||||
| final StringBuilder sb = new StringBuilder("WxPayOrder{"); | |||||
| sb.append("appid='").append(appid).append('\''); | |||||
| sb.append(", mch_id='").append(mch_id).append('\''); | |||||
| sb.append(", nonce_str='").append(nonce_str).append('\''); | |||||
| sb.append(", sign='").append(sign).append('\''); | |||||
| sb.append(", out_trade_no='").append(out_trade_no).append('\''); | |||||
| sb.append('}'); | |||||
| return sb.toString(); | |||||
| } | |||||
| } | |||||
| @@ -7,4 +7,6 @@ public interface DataTowerService { | |||||
| Map<String,Object> queryRunning(String tenantId); | Map<String,Object> queryRunning(String tenantId); | ||||
| Map<String,Object> queryCar(String tenantId); | |||||
| } | } | ||||
| @@ -48,10 +48,19 @@ public interface WxCUserBasicInfoService { | |||||
| */ | */ | ||||
| void updateScore(WxCUserBasicInfo record); | void updateScore(WxCUserBasicInfo record); | ||||
| /** | |||||
| * 根据性别查询数量 | |||||
| * @param sex | |||||
| * @return | |||||
| */ | |||||
| long findCountBySex(WxCuerBasicInfoDto dto); | |||||
| /** | |||||
| * 根据年龄查询数量 | |||||
| * @param dto | |||||
| * @return | |||||
| */ | |||||
| long findCountByAge(WxCuerBasicInfoDto dto); | |||||
| @@ -1,8 +1,7 @@ | |||||
| package com.simple.service; | package com.simple.service; | ||||
| import java.util.*; | |||||
| import com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| import com.simple.domain.dto.WxCuerBasicInfoDto; | |||||
| import com.simple.domain.po.WxCUser; | import com.simple.domain.po.WxCUser; | ||||
| public interface WxCUserService { | public interface WxCUserService { | ||||
| @@ -55,5 +54,10 @@ public interface WxCUserService { | |||||
| */ | */ | ||||
| void deleteById(Long id); | void deleteById(Long id); | ||||
| /** | |||||
| * 根据性别统计数量 | |||||
| * @param dto | |||||
| * @return | |||||
| */ | |||||
| long findCountBySex(WxCuerBasicInfoDto dto); | |||||
| } | } | ||||
| @@ -4,6 +4,8 @@ import com.github.pagehelper.PageInfo; | |||||
| import com.simple.domain.po.WxCouponChannel; | import com.simple.domain.po.WxCouponChannel; | ||||
| import com.simple.domain.vo.WxCouponChannelVo; | import com.simple.domain.vo.WxCouponChannelVo; | ||||
| import java.util.Date; | |||||
| public interface WxCouponChannelService { | public interface WxCouponChannelService { | ||||
| /** | /** | ||||
| @@ -40,7 +42,9 @@ public interface WxCouponChannelService { | |||||
| */ | */ | ||||
| void deleteById(Long id); | void deleteById(Long id); | ||||
| void addBatch(String[] ids,String[] channelId,String tanantId); | |||||
| void addBatch(String[] ids, String[] channelId, String tanantId, Date beginTime,Date endTime); | |||||
| void updateStatusByCouponId(Long couponId,String tenantId,int status); | |||||
| @@ -95,4 +95,16 @@ public interface WxCouponOrderService { | |||||
| * @param bUserId B端用户 | * @param bUserId B端用户 | ||||
| */ | */ | ||||
| ResultData detailBUserVo(Long bUserId, String couponOrderId); | ResultData detailBUserVo(Long bUserId, String couponOrderId); | ||||
| /** | |||||
| * A端查询分页列表 | |||||
| * | |||||
| * @param wxCouponOrder | |||||
| * @param pageIndex | |||||
| * @param pageSize | |||||
| * @return | |||||
| */ | |||||
| ResultData listAdminAsPage(WxCouponOrder wxCouponOrder, Integer pageIndex, Integer pageSize); | |||||
| } | } | ||||
| @@ -37,6 +37,16 @@ public interface WxCouponSendService { | |||||
| * @param id | * @param id | ||||
| */ | */ | ||||
| void deleteById(Long id); | void deleteById(Long id); | ||||
| /** | |||||
| *停车或核销给用户注入卡券 | |||||
| * @param tenantId | |||||
| * @param cUserId | |||||
| * @param type 2:停车发券 3:核销发券 | |||||
| */ | |||||
| void sendCouponToUser(String tenantId,Long cUserId,int type); | |||||
| void updateStatusByCouponId(Long couponId,String tenantId,int status); | |||||
| @@ -2,7 +2,9 @@ package com.simple.service; | |||||
| import java.util.*; | import java.util.*; | ||||
| import com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| import com.simple.common.ResultData; | |||||
| import com.simple.domain.po.WxCoupon; | import com.simple.domain.po.WxCoupon; | ||||
| import com.simple.domain.po.WxCouponChannel; | |||||
| import com.simple.domain.vo.WxCouponCVo; | import com.simple.domain.vo.WxCouponCVo; | ||||
| public interface WxCouponService { | public interface WxCouponService { | ||||
| @@ -60,8 +62,9 @@ public interface WxCouponService { | |||||
| */ | */ | ||||
| PageInfo<WxCoupon> findCanSendList(WxCoupon record, Integer pageIndex, Integer pageSize); | PageInfo<WxCoupon> findCanSendList(WxCoupon record, Integer pageIndex, Integer pageSize); | ||||
| PageInfo<WxCouponCVo> findListForCUser(WxCoupon record, Integer pageIndex, Integer pageSize); | |||||
| WxCouponCVo selectDetailForCUser(WxCoupon record); | |||||
| WxCouponCVo selectDetailForCUser(WxCouponChannel record); | |||||
| ResultData updateCoupon(WxCoupon wxCoupon); | |||||
| } | } | ||||
| @@ -0,0 +1,48 @@ | |||||
| package com.simple.service; | |||||
| import java.util.*; | |||||
| import com.github.pagehelper.PageInfo; | |||||
| import com.simple.domain.po.WxMallConfig; | |||||
| public interface WxMallConfigService { | |||||
| /** | |||||
| * 根据实体查询分页列表 | |||||
| * | |||||
| * @param record | |||||
| * @param offset | |||||
| * @param limit | |||||
| * @return | |||||
| */ | |||||
| PageInfo<WxMallConfig> listAsPage(WxMallConfig record, Integer pageIndex, Integer pageSize); | |||||
| /** | |||||
| * 根据Id获得实体 | |||||
| * | |||||
| * @param id | |||||
| * @return | |||||
| */ | |||||
| WxMallConfig getById(Long id); | |||||
| /** | |||||
| * 保存或更新实体 | |||||
| * | |||||
| * @param record | |||||
| */ | |||||
| void saveOrUpdate(WxMallConfig record); | |||||
| /** | |||||
| * 根据Id删除实体 | |||||
| * | |||||
| * @param id | |||||
| */ | |||||
| void deleteById(Long id); | |||||
| } | |||||
| @@ -57,6 +57,6 @@ public interface WxMerchantBUserService { | |||||
| boolean hasphone(String phone); | boolean hasphone(String phone); | ||||
| ResultData updatepwd(String phone, String code, String pwd); | |||||
| ResultData updatepwd(String appId, String phone, String code, String pwd); | |||||
| } | } | ||||
| @@ -1,10 +1,12 @@ | |||||
| package com.simple.service; | package com.simple.service; | ||||
| import java.util.*; | import java.util.*; | ||||
| import com.github.pagehelper.PageHelper; | |||||
| import com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| import com.simple.domain.po.WxCUser; | import com.simple.domain.po.WxCUser; | ||||
| import com.simple.domain.po.WxOrder; | import com.simple.domain.po.WxOrder; | ||||
| import com.simple.domain.vo.OrderVo; | |||||
| import com.simple.domain.vo.WxOrderCVo; | |||||
| import com.simple.enums.EnumOrderStatus; | import com.simple.enums.EnumOrderStatus; | ||||
| public interface WxOrderService { | public interface WxOrderService { | ||||
| @@ -19,22 +21,6 @@ public interface WxOrderService { | |||||
| */ | */ | ||||
| PageInfo<WxOrder> listAsPage(WxOrder record, Integer pageIndex, Integer pageSize); | PageInfo<WxOrder> listAsPage(WxOrder record, Integer pageIndex, Integer pageSize); | ||||
| /** | |||||
| * 根据实体查询分页列表 | |||||
| * | |||||
| * @param orderVo | |||||
| * @param pageIndex | |||||
| * @param pageSize | |||||
| * @return | |||||
| */ | |||||
| PageInfo<Map<String,Object>> bQueryListMap(OrderVo orderVo, Integer pageIndex, Integer pageSize); | |||||
| /** | |||||
| * 查询券详情 | |||||
| * @param orderVo | |||||
| * @return | |||||
| */ | |||||
| Map<String,Object> queryObject(OrderVo orderVo); | |||||
| /** | /** | ||||
| * 提交订单 | * 提交订单 | ||||
| @@ -94,12 +80,11 @@ public interface WxOrderService { | |||||
| */ | */ | ||||
| List<WxOrder> findList(WxOrder record); | List<WxOrder> findList(WxOrder record); | ||||
| PageInfo<WxOrderCVo> listCUserVoAsPage(WxOrder record, Integer pageIndex, Integer pageSize); | |||||
| WxOrderCVo detailCUserVo(WxOrder record); | |||||
| } | } | ||||
| @@ -20,6 +20,20 @@ public interface WxPayOrderService { | |||||
| */ | */ | ||||
| ResultData createPayOrder(boolean isReal, WxAppinfo appInfo, WxCUser user, WxPayOrder record, EnumPayWay payWay); | ResultData createPayOrder(boolean isReal, WxAppinfo appInfo, WxCUser user, WxPayOrder record, EnumPayWay payWay); | ||||
| /** | |||||
| * 微信支付订单查询 | |||||
| * @param appInfo 支付订单Appinfo | |||||
| * @param record 支付订单 | |||||
| */ | |||||
| ResultData payOrderQuery(WxAppinfo appInfo, WxPayOrder record); | |||||
| /** | |||||
| * 微信支付关闭订单 | |||||
| * @param appInfo 支付订单Appinfo | |||||
| * @param record 支付订单 | |||||
| */ | |||||
| ResultData payOrderClose(WxAppinfo appInfo, WxPayOrder record); | |||||
| /** | /** | ||||
| * 异步通知 | * 异步通知 | ||||
| * | * | ||||
| @@ -72,6 +72,10 @@ public class CouponInjectServiceImpl implements CouponInjectService { | |||||
| return new ResultData(Result.ERROR,"已过期"); | return new ResultData(Result.ERROR,"已过期"); | ||||
| } | } | ||||
| } | } | ||||
| if(wxCoupon.getStatus()!=0||wxCoupon.getSendType()!=1){ | |||||
| return new ResultData(Result.ERROR,"券状态有问题,不能投放"); | |||||
| } | |||||
| //解析前台tags,并转换json | //解析前台tags,并转换json | ||||
| String[] arys = record.getTags().split(","); | String[] arys = record.getTags().split(","); | ||||
| List<Long> tagids = new ArrayList<>(); | List<Long> tagids = new ArrayList<>(); | ||||
| @@ -97,6 +101,7 @@ public class CouponInjectServiceImpl implements CouponInjectService { | |||||
| if(cUsers.size()>inventory){ | if(cUsers.size()>inventory){ | ||||
| return new ResultData(Result.ERROR,"库存不足"); | return new ResultData(Result.ERROR,"库存不足"); | ||||
| } | } | ||||
| record.setCouponName(wxCoupon.getTitle()); | |||||
| record.setSendAmount(cUsers.size()); | record.setSendAmount(cUsers.size()); | ||||
| couponInjectMapper.insertSelective(record); | couponInjectMapper.insertSelective(record); | ||||
| if(record.getSendType()==0) { | if(record.getSendType()==0) { | ||||
| @@ -1,15 +1,16 @@ | |||||
| package com.simple.service.impl; | package com.simple.service.impl; | ||||
| import com.simple.common.ErrorCode; | |||||
| import com.simple.domain.po.WxMerchant; | import com.simple.domain.po.WxMerchant; | ||||
| import com.simple.domain.po.WxMerchantTradeDaily; | import com.simple.domain.po.WxMerchantTradeDaily; | ||||
| import com.simple.domain.po.WxShop; | 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.enums.EnumCarCmd; | |||||
| import com.simple.mapper.*; | |||||
| import com.simple.service.DataTowerService; | import com.simple.service.DataTowerService; | ||||
| import com.simple.utils.DateUtils; | import com.simple.utils.DateUtils; | ||||
| import org.apache.commons.collections.map.TransformedMap; | |||||
| import org.apache.log4j.Logger; | import org.apache.log4j.Logger; | ||||
| import org.apache.shiro.crypto.hash.Hash; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.stereotype.Service; | import org.springframework.stereotype.Service; | ||||
| @@ -35,6 +36,10 @@ public class DataTowerServiceImpl implements DataTowerService { | |||||
| @Autowired | @Autowired | ||||
| WxDateAmountRecordMapper wxDateAmountRecordMapper; | WxDateAmountRecordMapper wxDateAmountRecordMapper; | ||||
| @Autowired | |||||
| WxCarCmdLogMapper wxCarCmdLogMapper; | |||||
| @Override | @Override | ||||
| public Map<String, Object> queryRunning(String tenantId) { | public Map<String, Object> queryRunning(String tenantId) { | ||||
| @@ -115,4 +120,132 @@ public class DataTowerServiceImpl implements DataTowerService { | |||||
| return datamap; | return datamap; | ||||
| } | } | ||||
| @Override | |||||
| public Map<String, Object> queryCar(String tenantId) { | |||||
| HashMap<Object, Object> params = new HashMap<>(); | |||||
| params.put("tenantId",tenantId); | |||||
| params.put("cmdType",EnumCarCmd.CAR_ETCP_CALLBACK_PARK_OUT.getCode()); | |||||
| String startdate = DateUtils.getTimeBefore(7, new Date()); | |||||
| String systemTime = DateUtils.getSystemTime("yyyy-MM-dd"); | |||||
| List<String> tjTimeList = DateUtils.getTjTimeList(startdate, systemTime, "0"); | |||||
| params.put("startdate",startdate+" 00:00:00"); | |||||
| params.put("enddate",systemTime+" 23:59:59"); | |||||
| List<Map<String,Object>> historylist=wxCarCmdLogMapper.queryHistory(params); | |||||
| Map<Object, Object> collect = historylist.stream().collect(Collectors.toMap(m -> { | |||||
| return m.get("create_date"); | |||||
| }, m -> { | |||||
| return m.get("carcount"); | |||||
| })); | |||||
| for(String date:tjTimeList){ | |||||
| Object o = collect.get(date); | |||||
| if(o==null){ | |||||
| collect.put(date,0l); | |||||
| } | |||||
| } | |||||
| TreeMap<Object, Object> historymap = new TreeMap<>(); | |||||
| historymap.putAll(collect); | |||||
| Map<String, Object> datamap = new HashMap<>(); | |||||
| datamap.put("history",historymap); | |||||
| //今日车流量 | |||||
| long todaycar = (long) collect.get(systemTime); | |||||
| datamap.put("todaycar",todaycar); | |||||
| //环比 | |||||
| long yesterdaycar = (long) collect.get(tjTimeList.get(8 - 2)); | |||||
| if(yesterdaycar>0){ | |||||
| double hbd = (double) (todaycar - yesterdaycar) / yesterdaycar *100; | |||||
| double hb = new BigDecimal(hbd).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); | |||||
| datamap.put("hb",hb); | |||||
| }else{ | |||||
| datamap.put("hb","--"); | |||||
| } | |||||
| //上周同期 | |||||
| long last = (long) collect.get(tjTimeList.get(0)); | |||||
| if(last>0){ | |||||
| double lasthbd = (double) (todaycar - last) / last *100; | |||||
| double lasthb = new BigDecimal(lasthbd).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); | |||||
| datamap.put("lasthb",lasthb); | |||||
| }else{ | |||||
| datamap.put("lasthb","--"); | |||||
| } | |||||
| params.put("startdate",systemTime+" 05:00:00"); | |||||
| params.put("enddate",systemTime+" 22:59:59"); | |||||
| List<Map<String,Object>> todayCarlist=wxCarCmdLogMapper.queryTodayCar(params); | |||||
| Map<Object, Object> todaycollect = todayCarlist.stream().collect(Collectors.toMap(m -> { | |||||
| return m.get("create_time"); | |||||
| }, m -> { | |||||
| return m.get("carcount"); | |||||
| })); | |||||
| TreeMap todaytreemap = getTimeTreeMap(); | |||||
| todaytreemap.putAll(todaycollect); | |||||
| datamap.put("todaycardata",todaytreemap); | |||||
| String yesterday = DateUtils.getTimeBefore(1, new Date()); | |||||
| params.put("startdate",yesterday+" 05:00:00"); | |||||
| params.put("enddate",yesterday+" 22:59:59"); | |||||
| List<Map<String,Object>> yesterdayCarlist=wxCarCmdLogMapper.queryTodayCar(params); | |||||
| Map<Object, Object> yesterdaycollect = yesterdayCarlist.stream().collect(Collectors.toMap(m -> { | |||||
| return m.get("create_time"); | |||||
| }, m -> { | |||||
| return m.get("carcount"); | |||||
| })); | |||||
| TreeMap yesterdaytreemap = getTimeTreeMap(); | |||||
| yesterdaytreemap.putAll(yesterdaycollect); | |||||
| datamap.put("yesterdaycardata",yesterdaytreemap); | |||||
| params.put("startdate",startdate+" 05:00:00"); | |||||
| params.put("enddate",startdate+" 22:59:59"); | |||||
| List<Map<String,Object>> lastdayCarlist=wxCarCmdLogMapper.queryTodayCar(params); | |||||
| Map<Object, Object> lastdaycollect = lastdayCarlist.stream().collect(Collectors.toMap(m -> { | |||||
| return m.get("create_time"); | |||||
| }, m -> { | |||||
| return m.get("carcount"); | |||||
| })); | |||||
| TreeMap lastdaytreemap = getTimeTreeMap(); | |||||
| lastdaytreemap.putAll(lastdaycollect); | |||||
| datamap.put("lastdaycardata",lastdaytreemap); | |||||
| return datamap; | |||||
| } | |||||
| public TreeMap getTimeTreeMap(){ | |||||
| TreeMap<Object,Object> timemap=new TreeMap(); | |||||
| timemap.put("06:00",0); | |||||
| timemap.put("07:00",0); | |||||
| timemap.put("08:00",0); | |||||
| timemap.put("09:00",0); | |||||
| timemap.put("10:00",0); | |||||
| timemap.put("11:00",0); | |||||
| timemap.put("12:00",0); | |||||
| timemap.put("13:00",0); | |||||
| timemap.put("14:00",0); | |||||
| timemap.put("15:00",0); | |||||
| timemap.put("16:00",0); | |||||
| timemap.put("17:00",0); | |||||
| timemap.put("18:00",0); | |||||
| timemap.put("19:00",0); | |||||
| timemap.put("20:00",0); | |||||
| timemap.put("21:00",0); | |||||
| timemap.put("22:00",0); | |||||
| timemap.put("23:00",0); | |||||
| return timemap; | |||||
| } | |||||
| } | } | ||||
| @@ -1,15 +1,15 @@ | |||||
| package com.simple.service.impl; | package com.simple.service.impl; | ||||
| import java.util.*; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.stereotype.Service; | |||||
| import com.github.pagehelper.PageHelper; | import com.github.pagehelper.PageHelper; | ||||
| import com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| import com.simple.common.IdWorker; | |||||
| import com.simple.domain.dto.WxCuerBasicInfoDto; | import com.simple.domain.dto.WxCuerBasicInfoDto; | ||||
| import com.simple.domain.po.WxCUserBasicInfo; | import com.simple.domain.po.WxCUserBasicInfo; | ||||
| import com.simple.mapper.WxCUserBasicInfoMapper; | import com.simple.mapper.WxCUserBasicInfoMapper; | ||||
| import com.simple.service.WxCUserBasicInfoService; | import com.simple.service.WxCUserBasicInfoService; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.stereotype.Service; | |||||
| import com.simple.common.IdWorker; | |||||
| @Service | @Service | ||||
| public class WxCUserBasicInfoServiceImpl implements WxCUserBasicInfoService { | public class WxCUserBasicInfoServiceImpl implements WxCUserBasicInfoService { | ||||
| @@ -35,6 +35,7 @@ public class WxCUserBasicInfoServiceImpl implements WxCUserBasicInfoService { | |||||
| wxCUserBasicInfoMapper.updateScore(record); | wxCUserBasicInfoMapper.updateScore(record); | ||||
| } | } | ||||
| @Override | @Override | ||||
| @@ -58,12 +59,22 @@ public class WxCUserBasicInfoServiceImpl implements WxCUserBasicInfoService { | |||||
| public void deleteById(Long id) { | public void deleteById(Long id) { | ||||
| wxCUserBasicInfoMapper.deleteByPrimaryKey(id); | wxCUserBasicInfoMapper.deleteByPrimaryKey(id); | ||||
| } | } | ||||
| @Override | |||||
| public long findCountBySex(WxCuerBasicInfoDto dto) { | |||||
| return wxCUserBasicInfoMapper.findCountBySex(dto); | |||||
| } | |||||
| @Override | |||||
| public long findCountByAge(WxCuerBasicInfoDto dto) { | |||||
| return wxCUserBasicInfoMapper.findCountByAge(dto); | |||||
| } | |||||
| } | } | ||||
| @@ -3,6 +3,7 @@ package com.simple.service.impl; | |||||
| import java.util.*; | import java.util.*; | ||||
| import com.github.pagehelper.PageHelper; | import com.github.pagehelper.PageHelper; | ||||
| import com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| import com.simple.domain.dto.WxCuerBasicInfoDto; | |||||
| import com.simple.domain.po.WxCUser; | import com.simple.domain.po.WxCUser; | ||||
| import com.simple.mapper.WxCUserMapper; | import com.simple.mapper.WxCUserMapper; | ||||
| import com.simple.service.WxCUserService; | import com.simple.service.WxCUserService; | ||||
| @@ -60,6 +61,12 @@ public class WxCUserServiceImpl implements WxCUserService { | |||||
| public void deleteById(Long id) { | public void deleteById(Long id) { | ||||
| wxCUserMapper.deleteByPrimaryKey(id); | wxCUserMapper.deleteByPrimaryKey(id); | ||||
| } | } | ||||
| @Override | |||||
| public long findCountBySex(WxCuerBasicInfoDto dto) { | |||||
| return wxCUserMapper.findCountBySex(dto); | |||||
| } | |||||
| } | } | ||||
| @@ -48,6 +48,7 @@ public class WxCouponActionLogServiceImpl implements WxCouponActionLogService { | |||||
| public void addOne(String tenantId, Long couponId, Long coupon_order_id, int channelType, Long channelId) { | public void addOne(String tenantId, Long couponId, Long coupon_order_id, int channelType, Long channelId) { | ||||
| WxCouponActionLog actionLog = new WxCouponActionLog(); | WxCouponActionLog actionLog = new WxCouponActionLog(); | ||||
| actionLog.setTenantId(tenantId); | actionLog.setTenantId(tenantId); | ||||
| actionLog.setCouponId(couponId); | |||||
| actionLog.setChannelId(channelId); | actionLog.setChannelId(channelId); | ||||
| actionLog.setCouponOrderId(coupon_order_id); | actionLog.setCouponOrderId(coupon_order_id); | ||||
| actionLog.setChannelType(channelType); | actionLog.setChannelType(channelType); | ||||
| @@ -11,6 +11,7 @@ import com.simple.domain.vo.WxCouponChannelVo; | |||||
| import com.simple.mapper.WxCouponChannelMapper; | import com.simple.mapper.WxCouponChannelMapper; | ||||
| import com.simple.service.WxCouponChannelService; | import com.simple.service.WxCouponChannelService; | ||||
| import com.simple.service.WxCouponService; | import com.simple.service.WxCouponService; | ||||
| import org.apache.log4j.Logger; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.stereotype.Service; | import org.springframework.stereotype.Service; | ||||
| import com.simple.common.IdWorker; | import com.simple.common.IdWorker; | ||||
| @@ -24,6 +25,7 @@ public class WxCouponChannelServiceImpl implements WxCouponChannelService { | |||||
| @Autowired | @Autowired | ||||
| WxCouponService wxCouponService; | WxCouponService wxCouponService; | ||||
| private Logger logger = Logger.getLogger(getClass()); | |||||
| /** | /** | ||||
| * B端业务端 | * B端业务端 | ||||
| @@ -60,32 +62,62 @@ public class WxCouponChannelServiceImpl implements WxCouponChannelService { | |||||
| } | } | ||||
| @Override | @Override | ||||
| @Transactional | |||||
| public void addBatch(String[] ids,String[] channelId,String tanantId) { | |||||
| public void addBatch(String[] ids,String[] channelId,String tanantId,Date beginTime,Date endTime) { | |||||
| for (String targetIdstr:channelId) { | for (String targetIdstr:channelId) { | ||||
| Integer targetId = Integer.parseInt(targetIdstr); | Integer targetId = Integer.parseInt(targetIdstr); | ||||
| for (String couponidstr:ids) { | for (String couponidstr:ids) { | ||||
| Long couponid = Long.parseLong(couponidstr); | Long couponid = Long.parseLong(couponidstr); | ||||
| addCuponChannel(couponid,targetId,tanantId); | |||||
| addCuponChannel(couponid,targetId,tanantId,beginTime,endTime); | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| @Override | |||||
| public void updateStatusByCouponId(Long couponId, String tenantId, int status) { | |||||
| WxCouponChannel wxCouponChannel = new WxCouponChannel(); | |||||
| wxCouponChannel.setTenantId(tenantId); | |||||
| wxCouponChannel.setStatus(status); | |||||
| wxCouponChannel.setCouponId(couponId); | |||||
| } | |||||
| @Transactional | @Transactional | ||||
| public void addCuponChannel(Long couponid,Integer channelId,String tanantId){ | |||||
| public void addCuponChannel(Long couponid,Integer channelId,String tanantId,Date beginTime,Date endTime){ | |||||
| WxCouponChannel wxCouponChannelQuery = new WxCouponChannel(); | |||||
| wxCouponChannelQuery.setTenantId(tanantId); | |||||
| wxCouponChannelQuery.setCouponId(couponid); | |||||
| wxCouponChannelQuery.setTargetAd(channelId); | |||||
| wxCouponChannelQuery.setStatus(0); | |||||
| List<WxCouponChannel> wxCouponChannels = wxCouponChannelMapper.findList(wxCouponChannelQuery); | |||||
| if(wxCouponChannels.size()>0){ | |||||
| logger.debug(couponid+"已经投放过了"); | |||||
| return; | |||||
| } | |||||
| WxCoupon wxCoupon = wxCouponService.getById(couponid); | WxCoupon wxCoupon = wxCouponService.getById(couponid); | ||||
| if(wxCoupon.getStatus()!=1) { | |||||
| wxCoupon.setStatus(1); | |||||
| wxCouponService.saveOrUpdate(wxCoupon); | |||||
| if(wxCoupon.getStatus()!=0) { | |||||
| logger.debug(wxCoupon.getId()+"状态不对"); | |||||
| return; | |||||
| } | |||||
| if(wxCoupon.getValidEndDate().before(endTime)){ | |||||
| logger.debug(wxCoupon.getId()+"发放时间不能晚于使用时间"); | |||||
| return; | |||||
| } | } | ||||
| WxCouponChannel wxCouponChannel = new WxCouponChannel(); | WxCouponChannel wxCouponChannel = new WxCouponChannel(); | ||||
| wxCouponChannel.setEndTime(endTime); | |||||
| wxCouponChannel.setStatus(0); | |||||
| wxCouponChannel.setBeginTime(beginTime); | |||||
| wxCouponChannel.setCouponId(couponid); | wxCouponChannel.setCouponId(couponid); | ||||
| wxCouponChannel.setCouponStatus(1); | |||||
| wxCouponChannel.setMerchantId(wxCoupon.getMerchantId()); | |||||
| wxCouponChannel.setType(wxCoupon.getType()); | |||||
| wxCouponChannel.setTargetAd(channelId); | wxCouponChannel.setTargetAd(channelId); | ||||
| wxCouponChannel.setTenantId(tanantId); | wxCouponChannel.setTenantId(tanantId); | ||||
| wxCouponChannel.setBusiness(wxCoupon.getBusiness()); | |||||
| wxCouponChannel.setTitle(wxCoupon.getTitle()); | |||||
| saveOrUpdate(wxCouponChannel); | saveOrUpdate(wxCouponChannel); | ||||
| } | } | ||||
| @@ -7,6 +7,7 @@ import com.simple.common.IdWorker; | |||||
| import com.simple.common.Result; | import com.simple.common.Result; | ||||
| import com.simple.common.ResultData; | import com.simple.common.ResultData; | ||||
| import com.simple.domain.po.*; | import com.simple.domain.po.*; | ||||
| import com.simple.domain.vo.WxCouponOrderBVo; | |||||
| import com.simple.domain.vo.WxCouponOrderCVo; | import com.simple.domain.vo.WxCouponOrderCVo; | ||||
| import com.simple.enums.EnumCouponOrderStatus; | import com.simple.enums.EnumCouponOrderStatus; | ||||
| import com.simple.enums.EnumCouponStatus; | import com.simple.enums.EnumCouponStatus; | ||||
| @@ -47,6 +48,8 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService { | |||||
| return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxCouponOrderMapper.findList(record)); | return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxCouponOrderMapper.findList(record)); | ||||
| } | } | ||||
| @Override | @Override | ||||
| public WxCouponOrder getById(Long id) { | public WxCouponOrder getById(Long id) { | ||||
| return wxCouponOrderMapper.selectByPrimaryKey(id); | return wxCouponOrderMapper.selectByPrimaryKey(id); | ||||
| @@ -209,6 +212,11 @@ public class WxCouponOrderServiceImpl implements WxCouponOrderService { | |||||
| return new ResultData(wxCouponOrderCVo); | return new ResultData(wxCouponOrderCVo); | ||||
| } | } | ||||
| @Override | |||||
| public ResultData listAdminAsPage(WxCouponOrder wxCouponOrder, Integer pageIndex, Integer pageSize) { | |||||
| return new ResultData(PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxCouponOrderMapper.findListOfAdmin(wxCouponOrder))); | |||||
| } | |||||
| @Override | @Override | ||||
| @Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class}) | @Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class}) | ||||
| @@ -3,9 +3,15 @@ package com.simple.service.impl; | |||||
| import java.util.*; | import java.util.*; | ||||
| import com.github.pagehelper.PageHelper; | import com.github.pagehelper.PageHelper; | ||||
| import com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| import com.simple.domain.po.WxCoupon; | |||||
| import com.simple.domain.po.WxCouponOrder; | |||||
| import com.simple.domain.po.WxCouponSend; | import com.simple.domain.po.WxCouponSend; | ||||
| import com.simple.mapper.WxCouponSendMapper; | import com.simple.mapper.WxCouponSendMapper; | ||||
| import com.simple.service.WxCouponActionLogService; | |||||
| import com.simple.service.WxCouponOrderService; | |||||
| import com.simple.service.WxCouponSendService; | import com.simple.service.WxCouponSendService; | ||||
| import com.simple.service.WxCouponService; | |||||
| import org.apache.commons.lang.time.DateUtils; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.stereotype.Service; | import org.springframework.stereotype.Service; | ||||
| import com.simple.common.IdWorker; | import com.simple.common.IdWorker; | ||||
| @@ -15,6 +21,12 @@ public class WxCouponSendServiceImpl implements WxCouponSendService { | |||||
| @Autowired | @Autowired | ||||
| WxCouponSendMapper wxCouponSendMapper; | WxCouponSendMapper wxCouponSendMapper; | ||||
| @Autowired | |||||
| WxCouponOrderService wxCouponOrderService; | |||||
| @Autowired | |||||
| WxCouponService wxCouponService; | |||||
| @Autowired | |||||
| WxCouponActionLogService wxCouponActionLogService; | |||||
| @Override | @Override | ||||
| @@ -43,12 +55,58 @@ public class WxCouponSendServiceImpl implements WxCouponSendService { | |||||
| public void deleteById(Long id) { | public void deleteById(Long id) { | ||||
| wxCouponSendMapper.deleteByPrimaryKey(id); | wxCouponSendMapper.deleteByPrimaryKey(id); | ||||
| } | } | ||||
| @Override | |||||
| public void sendCouponToUser(String tenantId, Long cUserId, int type) { | |||||
| //查询开关是否打开 | |||||
| //查询停车或者核销的券 | |||||
| WxCouponSend wxCouponSendQuery = new WxCouponSend(); | |||||
| wxCouponSendQuery.setTenantId(tenantId); | |||||
| int actionLogType=0; | |||||
| if(type==2){ | |||||
| //停车 | |||||
| wxCouponSendQuery.setSendType(2); | |||||
| actionLogType=3; | |||||
| } | |||||
| if(type==3){ | |||||
| //核销 | |||||
| wxCouponSendQuery.setSendType(3); | |||||
| actionLogType=4; | |||||
| }else{ | |||||
| return; | |||||
| } | |||||
| List<WxCouponSend> wxCouponSends = wxCouponSendMapper.findList(wxCouponSendQuery); | |||||
| for (WxCouponSend send:wxCouponSends) { | |||||
| WxCoupon wxCoupon= wxCouponService.getById(send.getCouponId()); | |||||
| WxCouponOrder wxCouponOrder = new WxCouponOrder(); | |||||
| wxCouponOrder.setCouponId(wxCoupon.getId()); | |||||
| wxCouponOrder.setCouponOrderStatus(0); | |||||
| wxCouponOrder.setCUserId(cUserId); | |||||
| wxCouponOrder.setCouponPrice(0); | |||||
| wxCouponOrder.setCreateDate(new Date()); | |||||
| if (wxCoupon.getValidType() == 1) { //时间范围区间 | |||||
| wxCouponOrder.setExpiredTime(wxCoupon.getValidEndDate()); | |||||
| } else { | |||||
| Date date = DateUtils.addDays(new Date(), wxCoupon.getValidDays()); | |||||
| wxCouponOrder.setExpiredTime(date); | |||||
| } | |||||
| wxCouponOrder.setTenantId(wxCoupon.getTenantId()); | |||||
| Long couponOrderId = wxCouponOrderService.insertOne(wxCouponOrder); | |||||
| wxCouponActionLogService.addOne(tenantId, wxCoupon.getId(), couponOrderId, actionLogType, send.getId()); | |||||
| } | |||||
| } | |||||
| @Override | |||||
| public void updateStatusByCouponId(Long couponId, String tenantId, int status) { | |||||
| WxCouponSend wxCouponSend = new WxCouponSend(); | |||||
| wxCouponSend.setTenantId(tenantId); | |||||
| wxCouponSend.setCouponId(couponId); | |||||
| wxCouponSend.setStatus(status); | |||||
| wxCouponSendMapper.updateStatusByCouponId(wxCouponSend); | |||||
| } | |||||
| } | } | ||||
| @@ -3,19 +3,33 @@ package com.simple.service.impl; | |||||
| import java.util.*; | import java.util.*; | ||||
| import com.github.pagehelper.PageHelper; | import com.github.pagehelper.PageHelper; | ||||
| import com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| import com.simple.common.Result; | |||||
| import com.simple.common.ResultData; | |||||
| import com.simple.domain.po.WxCoupon; | import com.simple.domain.po.WxCoupon; | ||||
| import com.simple.domain.po.WxCouponChannel; | |||||
| import com.simple.domain.po.WxCouponSend; | |||||
| import com.simple.domain.vo.WxCouponCVo; | import com.simple.domain.vo.WxCouponCVo; | ||||
| import com.simple.mapper.WxCouponChannelMapper; | |||||
| import com.simple.mapper.WxCouponMapper; | import com.simple.mapper.WxCouponMapper; | ||||
| import com.simple.service.WxCampaignService; | |||||
| import com.simple.service.WxCouponChannelService; | |||||
| import com.simple.service.WxCouponSendService; | |||||
| import com.simple.service.WxCouponService; | import com.simple.service.WxCouponService; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.stereotype.Service; | import org.springframework.stereotype.Service; | ||||
| import com.simple.common.IdWorker; | import com.simple.common.IdWorker; | ||||
| import org.springframework.transaction.annotation.Transactional; | |||||
| @Service | @Service | ||||
| public class WxCouponServiceImpl implements WxCouponService { | public class WxCouponServiceImpl implements WxCouponService { | ||||
| @Autowired | @Autowired | ||||
| WxCouponMapper wxCouponMapper; | WxCouponMapper wxCouponMapper; | ||||
| @Autowired | |||||
| WxCouponChannelService wxCouponChannelService; | |||||
| @Autowired | |||||
| WxCouponSendService wxCouponSendService; | |||||
| @Override | @Override | ||||
| @@ -62,12 +76,24 @@ public class WxCouponServiceImpl implements WxCouponService { | |||||
| } | } | ||||
| @Override | @Override | ||||
| public PageInfo<WxCouponCVo> findListForCUser(WxCoupon record, Integer pageIndex, Integer pageSize) { | |||||
| return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxCouponMapper.findListForCUser(record)); | |||||
| public WxCouponCVo selectDetailForCUser(WxCouponChannel record) { | |||||
| return wxCouponMapper.selectDetailForCUser(record); | |||||
| } | } | ||||
| @Override | @Override | ||||
| public WxCouponCVo selectDetailForCUser(WxCoupon record) { | |||||
| return wxCouponMapper.selectDetailForCUser(record); | |||||
| @Transactional | |||||
| public ResultData updateCoupon(WxCoupon wxCoupon) { | |||||
| WxCoupon query = wxCouponMapper.selectByPrimaryKey(wxCoupon.getId()); | |||||
| if(wxCoupon.getStatus()!=null){ | |||||
| if(wxCoupon.getStatus()==1){ //已作废 | |||||
| //作废所有投放频道 | |||||
| wxCouponChannelService.updateStatusByCouponId(wxCoupon.getId(),query.getTenantId(),1); | |||||
| wxCouponSendService.updateStatusByCouponId(query.getId(),query.getTenantId(),1); | |||||
| } | |||||
| } | |||||
| return new ResultData(saveOrUpdate(wxCoupon)); | |||||
| } | } | ||||
| } | } | ||||
| @@ -0,0 +1,54 @@ | |||||
| package com.simple.service.impl; | |||||
| import java.util.*; | |||||
| import com.github.pagehelper.PageHelper; | |||||
| import com.github.pagehelper.PageInfo; | |||||
| import com.simple.domain.po.WxMallConfig; | |||||
| import com.simple.mapper.WxMallConfigMapper; | |||||
| import com.simple.service.WxMallConfigService; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.stereotype.Service; | |||||
| import com.simple.common.IdWorker; | |||||
| @Service | |||||
| public class WxMallConfigServiceImpl implements WxMallConfigService { | |||||
| @Autowired | |||||
| WxMallConfigMapper wxMallConfigMapper; | |||||
| @Override | |||||
| public PageInfo<WxMallConfig> listAsPage(WxMallConfig record, Integer pageIndex, Integer pageSize) { | |||||
| return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxMallConfigMapper.findList(record)); | |||||
| } | |||||
| @Override | |||||
| public WxMallConfig getById(Long id) { | |||||
| return wxMallConfigMapper.selectByPrimaryKey(id); | |||||
| } | |||||
| @Override | |||||
| public void saveOrUpdate(WxMallConfig record) { | |||||
| if (record.getId() == null) { | |||||
| //record.setId(UUID.randomUUID().toString().replaceAll("-", "")); | |||||
| IdWorker idWorker = new IdWorker(0, 0); | |||||
| record.setId(idWorker.nextId()); | |||||
| wxMallConfigMapper.insertSelective(record); | |||||
| } else { | |||||
| wxMallConfigMapper.updateByPrimaryKeySelective(record); | |||||
| } | |||||
| } | |||||
| @Override | |||||
| public void deleteById(Long id) { | |||||
| wxMallConfigMapper.deleteByPrimaryKey(id); | |||||
| } | |||||
| } | |||||
| @@ -7,9 +7,11 @@ import com.github.pagehelper.PageHelper; | |||||
| import com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| import com.simple.common.ErrorCode; | import com.simple.common.ErrorCode; | ||||
| import com.simple.common.ResultData; | import com.simple.common.ResultData; | ||||
| import com.simple.domain.po.WxAppinfo; | |||||
| import com.simple.domain.po.WxMerchantBUser; | import com.simple.domain.po.WxMerchantBUser; | ||||
| import com.simple.domain.po.WxMsgValidationcode; | import com.simple.domain.po.WxMsgValidationcode; | ||||
| import com.simple.exception.MallinkException; | import com.simple.exception.MallinkException; | ||||
| import com.simple.mapper.WxAppinfoMapper; | |||||
| import com.simple.mapper.WxMerchantBUserMapper; | import com.simple.mapper.WxMerchantBUserMapper; | ||||
| import com.simple.mapper.WxMsgValidationcodeMapper; | import com.simple.mapper.WxMsgValidationcodeMapper; | ||||
| import com.simple.service.WxMerchantBUserService; | import com.simple.service.WxMerchantBUserService; | ||||
| @@ -23,6 +25,8 @@ public class WxMerchantBUserServiceImpl implements WxMerchantBUserService { | |||||
| private Logger logger = Logger.getLogger(WxMerchantBUserServiceImpl.class); | private Logger logger = Logger.getLogger(WxMerchantBUserServiceImpl.class); | ||||
| @Autowired | |||||
| WxAppinfoMapper wxAppinfoMapper; | |||||
| @Autowired | @Autowired | ||||
| WxMerchantBUserMapper wxMerchantBUserMapper; | WxMerchantBUserMapper wxMerchantBUserMapper; | ||||
| @@ -90,7 +94,8 @@ public class WxMerchantBUserServiceImpl implements WxMerchantBUserService { | |||||
| } | } | ||||
| @Override | @Override | ||||
| public ResultData updatepwd(String phone, String code, String pwd) { | |||||
| public ResultData updatepwd(String appId, String phone, String code, String pwd) { | |||||
| WxAppinfo appinfo = wxAppinfoMapper.findByAppId(appId); | |||||
| WxMsgValidationcode wxMsgValidationcode = new WxMsgValidationcode(); | WxMsgValidationcode wxMsgValidationcode = new WxMsgValidationcode(); | ||||
| wxMsgValidationcode.setPhone(phone); | wxMsgValidationcode.setPhone(phone); | ||||
| wxMsgValidationcode.setCode(code); | wxMsgValidationcode.setCode(code); | ||||
| @@ -101,10 +106,13 @@ public class WxMerchantBUserServiceImpl implements WxMerchantBUserService { | |||||
| if(wxmsgvalidationcodelist.size()>0){ | if(wxmsgvalidationcodelist.size()>0){ | ||||
| //更新 | //更新 | ||||
| WxMerchantBUser bUser = new WxMerchantBUser(); | WxMerchantBUser bUser = new WxMerchantBUser(); | ||||
| bUser.setTenantId(appinfo.getTenantId()); | |||||
| bUser.setPhone(phone); | bUser.setPhone(phone); | ||||
| bUser.setAppId(appId); | |||||
| List<WxMerchantBUser> list = wxMerchantBUserMapper.findList(bUser); | List<WxMerchantBUser> list = wxMerchantBUserMapper.findList(bUser); | ||||
| if(list.size()>0){ | if(list.size()>0){ | ||||
| bUser = list.get(0); | bUser = list.get(0); | ||||
| bUser.setBUserPwd(pwd); | bUser.setBUserPwd(pwd); | ||||
| try{ | try{ | ||||
| wxMerchantBUserMapper.updateByPrimaryKeySelective(bUser); | wxMerchantBUserMapper.updateByPrimaryKeySelective(bUser); | ||||
| @@ -112,6 +120,9 @@ public class WxMerchantBUserServiceImpl implements WxMerchantBUserService { | |||||
| logger.error("db failed: 商户-" + bUser.getId() + ", e:" + e.getMessage()); | logger.error("db failed: 商户-" + bUser.getId() + ", e:" + e.getMessage()); | ||||
| throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "DB FAILD " + e.getMessage()); | throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "DB FAILD " + e.getMessage()); | ||||
| } | } | ||||
| } else { | |||||
| logger.error("B端用户不是这个app的用户:" + appId); | |||||
| throw new MallinkException(ErrorCode.BUSER_NOT_IN_APP); | |||||
| } | } | ||||
| } | } | ||||
| return new ResultData(); | return new ResultData(); | ||||
| @@ -1,5 +1,6 @@ | |||||
| package com.simple.service.impl; | package com.simple.service.impl; | ||||
| import com.alibaba.fastjson.JSON; | |||||
| import com.alibaba.fastjson.JSONObject; | import com.alibaba.fastjson.JSONObject; | ||||
| import com.github.pagehelper.PageHelper; | import com.github.pagehelper.PageHelper; | ||||
| import com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| @@ -122,7 +123,7 @@ public class WxMsgServiceImpl implements WxMsgService { | |||||
| for (int i = 0; i < arys.length; i++) { | for (int i = 0; i < arys.length; i++) { | ||||
| tagids.add(Long.parseLong(arys[i])); | tagids.add(Long.parseLong(arys[i])); | ||||
| } | } | ||||
| List<Long> userIds = wxCUserTagsMapper.findUserByTag(tagids); | |||||
| List<Long> userIds = wxCUserTagsMapper.findUserByTag(JSON.toJSONString(tagids)); | |||||
| if(userIds.size()==0) { | if(userIds.size()==0) { | ||||
| return ""; | return ""; | ||||
| } | } | ||||