Merge branch 'master' into 'test'
Master
See merge request root/zhihuishequ!1
103个文件已修改
2个文件已删除
97个文件已添加
| | |
| | | public R addVolunteer(@RequestBody @Validated(AddGroup.class) ComMngVolunteerMngVO comMngVolunteerMngVO){ |
| | | comMngVolunteerMngVO.setState(1); |
| | | comMngVolunteerMngVO.setCommunityId(this.getCommunityId()); |
| | | comMngVolunteerMngVO.setSubmitUserId(this.getUserId()); |
| | | return communityService.addVolunteer(comMngVolunteerMngVO); |
| | | } |
| | | |
| | |
| | | pageQuestnaireDTO.setForParty(1 == isPartymember.intValue()); |
| | | pageQuestnaireDTO.setForVolunteer(1 == isVolunteer.intValue()); |
| | | pageQuestnaireDTO.setUserId(loginUserInfo.getUserId()); |
| | | pageQuestnaireDTO.setState(0); |
| | | // pageQuestnaireDTO.setState(0); |
| | | return communityService.pageQuestnaire(pageQuestnaireDTO, loginUserInfo.getCommunityId()); |
| | | } |
| | | |
New file |
| | |
| | | package com.panzhihua.applets.api; |
| | | |
| | | import com.panzhihua.applets.config.WxMaProperties; |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.dtos.shop.*; |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.shop.*; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | import com.panzhihua.common.utlis.PayUtil; |
| | | import io.swagger.annotations.*; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | | import java.io.PrintWriter; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @auther lyq |
| | | * @create 2021-04-14 15:02:49 |
| | | * @describe 商城模块API |
| | | */ |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/shop/") |
| | | @Api(tags = {"商城服务"}) |
| | | public class ShopApi extends BaseController { |
| | | |
| | | @Resource |
| | | private CommunityService communityService; |
| | | @Resource |
| | | private WxMaProperties properties; |
| | | |
| | | @ApiOperation(value = "分页查询店铺" , response = PageShopStoreVO.class) |
| | | @PostMapping("pageshopstore") |
| | | public R pageShopStore(@RequestBody PageComShopStoreDTO comShopStoreDTO) { |
| | | return communityService.pageShopStore(comShopStoreDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询店铺详情" , response = PageShopStoreVO.class) |
| | | @PostMapping("shopstoredetail") |
| | | public R shopStoreDetail(@RequestBody PageComShopStoreDTO comShopStoreDTO) { |
| | | if(comShopStoreDTO == null || comShopStoreDTO.getStoreId() == null){ |
| | | return R.fail("参数错误"); |
| | | } |
| | | return communityService.shopStoreDetail(comShopStoreDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "分页查询商品列表" , response = ComShopGoodsVO.class) |
| | | @PostMapping("pageShopGoods") |
| | | public R pageShopGoods(@RequestBody ComShopGoodsDTO comShopGoodsDTO) { |
| | | return communityService.pageShopGoods(comShopGoodsDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询商品详情" , response = ComShopGoodsVO.class) |
| | | @PostMapping("shopGoodsDetail") |
| | | @ApiImplicitParam(name = "goodsId",value = "商品id",required = true) |
| | | public R shopGoodsDetail(@RequestParam("goodsId") Long goodsId) { |
| | | return communityService.shopGoodsDetail(goodsId); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询用户购物车列表" , response = ComShopCartVO.class) |
| | | @PostMapping("shopCartList") |
| | | public R shopCartList() { |
| | | Long userId = this.getUserId(); |
| | | if(userId == null){ |
| | | return R.fail("请重新登陆"); |
| | | } |
| | | return communityService.shopCartList(userId); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询用户购物车商品数量") |
| | | @PostMapping("shopCartUserTotal") |
| | | public R shopCartUserTotal() { |
| | | Long userId = this.getUserId(); |
| | | if(userId == null){ |
| | | return R.fail("请重新登陆"); |
| | | } |
| | | return communityService.shopCartUserTotal(userId); |
| | | } |
| | | |
| | | @ApiOperation(value = "购物车添加") |
| | | @PostMapping("shopAddCart") |
| | | public R shopAddCart(@RequestBody ComShopCartDTO comShopCartDTO) { |
| | | Long userId = this.getUserId(); |
| | | if(userId == null){ |
| | | return R.fail("请重新登陆"); |
| | | } |
| | | comShopCartDTO.setUserId(userId); |
| | | return communityService.shopAddCart(comShopCartDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "购物车修改") |
| | | @PostMapping("shopEditNubCart") |
| | | public R shopEditNubCart(@RequestBody ComShopEditNubCartDTO shopEditNubCartDTO) { |
| | | return communityService.shopEditNubCart(shopEditNubCartDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "购物车删除") |
| | | @PostMapping("shopDelCart") |
| | | public R shopDelCart(@RequestBody List<Long> Ids) { |
| | | return communityService.shopDelCart(Ids); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询用户收货地址列表" , response = ComShopUserAddressVO.class) |
| | | @PostMapping("shopUserAddressList") |
| | | public R shopUserAddressList(@RequestBody PageComShopAddressDTO comShopAddressDTO) { |
| | | Long userId = this.getUserId(); |
| | | if(userId == null){ |
| | | return R.fail("请重新登陆"); |
| | | } |
| | | comShopAddressDTO.setUserId(userId); |
| | | return communityService.shopUserAddressList(comShopAddressDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "添加用户收货地址列表") |
| | | @PostMapping("shopAddUserAddress") |
| | | public R shopAddUserAddress(@RequestBody ComShopAddressDTO comShopAddressDTO) { |
| | | Long userId = this.getUserId(); |
| | | if(userId == null){ |
| | | return R.fail("请重新登陆"); |
| | | } |
| | | comShopAddressDTO.setUserId(userId); |
| | | return communityService.shopAddUserAddress(comShopAddressDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "修改用户收货地址列表") |
| | | @PostMapping("shopEditUserAddress") |
| | | public R shopEditUserAddress(@RequestBody ComShopAddressDTO comShopAddressDTO) { |
| | | Long userId = this.getUserId(); |
| | | if(userId == null){ |
| | | return R.fail("请重新登陆"); |
| | | } |
| | | comShopAddressDTO.setUserId(userId); |
| | | return communityService.shopEditUserAddress(comShopAddressDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "删除用户收货地址列表") |
| | | @PostMapping("shopDelUserAddress") |
| | | @ApiImplicitParam(name = "addressId",value = "收货地址id",required = true) |
| | | public R shopDelUserAddress(@RequestParam("addressId") Long addressId) { |
| | | return communityService.shopDelUserAddress(addressId); |
| | | } |
| | | |
| | | @ApiOperation(value = "订单预览", response = ComShopOrderPreviewVO.class) |
| | | @PostMapping("orderPreview") |
| | | public R orderPreview(@RequestBody ComShopOrderPreviewDTO orderPreviewDTO) { |
| | | Long userId = this.getUserId(); |
| | | if(userId == null){ |
| | | return R.fail("请重新登陆"); |
| | | } |
| | | orderPreviewDTO.setUserId(userId); |
| | | return communityService.orderPreview(orderPreviewDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "创建订单", response = ComShopOrderVO.class) |
| | | @PostMapping("orderCreate") |
| | | public R orderCreate(@RequestBody ComShopOrderCreateDTO orderCreateDTO) { |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); |
| | | if(loginUserInfo == null){ |
| | | return R.fail("请重新登陆"); |
| | | } |
| | | orderCreateDTO.setUserId(loginUserInfo.getUserId()); |
| | | orderCreateDTO.setPhone(loginUserInfo.getPhone()); |
| | | orderCreateDTO.setOpenId(loginUserInfo.getOpenid()); |
| | | return communityService.orderCreate(orderCreateDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "分页查询订单列表", response = ComShopOrderPageVO.class) |
| | | @PostMapping("pageOrderList") |
| | | public R pageOrderList(@RequestBody PageComOrderListDTO comOrderListDTO) { |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); |
| | | if(loginUserInfo == null){ |
| | | return R.fail("请重新登陆"); |
| | | } |
| | | comOrderListDTO.setUserId(loginUserInfo.getUserId()); |
| | | return communityService.pageOrderList(comOrderListDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询订单详情", response = ComShopOrderPageVO.class) |
| | | @PostMapping("orderDetail") |
| | | @ApiImplicitParam(name = "orderId",value = "订单id",required = true) |
| | | public R orderDetail(@RequestParam("orderId") Long orderId) { |
| | | return communityService.orderDetail(orderId); |
| | | } |
| | | |
| | | @ApiOperation(value = "取消订单") |
| | | @PostMapping("orderCancel") |
| | | public R orderCancel(@RequestBody ComShopOrderQueryDTO comShopOrderQueryDTO) { |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); |
| | | if(loginUserInfo == null){ |
| | | return R.fail("请重新登陆"); |
| | | } |
| | | return communityService.orderCancel(comShopOrderQueryDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "删除订单") |
| | | @PostMapping("orderDelete") |
| | | @ApiImplicitParam(name = "orderId",value = "订单id",required = true) |
| | | public R orderDelete(@RequestParam("orderId") Long orderId) { |
| | | return communityService.orderDelete(orderId); |
| | | } |
| | | |
| | | @ApiOperation(value = "订单确认收货") |
| | | @PostMapping("orderConfirm") |
| | | public R orderConfirm(@RequestBody ComShopOrderQueryDTO comShopOrderQueryDTO) { |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); |
| | | if(loginUserInfo == null){ |
| | | return R.fail("请重新登陆"); |
| | | } |
| | | return communityService.orderConfirm(comShopOrderQueryDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "统计当前用户订单", response = OrderStatisticsVO.class) |
| | | @PostMapping("orderStatistics") |
| | | public R orderStatistics() { |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); |
| | | if(loginUserInfo == null){ |
| | | return R.fail("请重新登陆"); |
| | | } |
| | | return communityService.orderStatistics(loginUserInfo.getUserId()); |
| | | } |
| | | |
| | | @ApiOperation(value = "小程序微信调起支付") |
| | | @PostMapping("wxpay") |
| | | public R wxPay(@RequestBody OrderPayDTO orderPayDTO){ |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); |
| | | if(loginUserInfo == null){ |
| | | return R.fail("请重新登陆"); |
| | | } |
| | | orderPayDTO.setOpenId(loginUserInfo.getOpenid()); |
| | | return communityService.wxPay(orderPayDTO); |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.panzhihua.applets.weixin.CheckService; |
| | | import com.panzhihua.applets.model.dtos.ComPbMemberCertificationDTO; |
| | | import com.panzhihua.common.model.dtos.user.SysUserEditTipsDTO; |
| | | import com.panzhihua.common.model.dtos.user.SysUserFeedbackDTO; |
| | | import com.panzhihua.common.model.vos.community.*; |
| | | import com.panzhihua.common.model.vos.partybuilding.PartyBuildingMemberVO; |
| | | import com.panzhihua.common.model.vos.user.ComMngFamilyInfoVO; |
| | | import com.panzhihua.common.model.vos.user.SysUserNoticeVO; |
| | | import com.panzhihua.common.model.vos.user.UserPhoneVO; |
| | | import com.panzhihua.common.model.vos.user.*; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | import com.panzhihua.common.service.partybuilding.PartyBuildingService; |
| | | import com.panzhihua.common.service.user.UserService; |
| | |
| | | loginUserInfoVO.setUserId(userId); |
| | | R r = userService.putUserAuthentication(loginUserInfoVO); |
| | | if (R.isOk(r)) { |
| | | //通过不发通知 |
| | | //通过发通知 |
| | | SysUserNoticeVO sysUserNoticeVO=new SysUserNoticeVO(); |
| | | sysUserNoticeVO.setUserId(userId); |
| | | sysUserNoticeVO.setType(3); |
| | | sysUserNoticeVO.setTitle("实名制审核通过"); |
| | | sysUserNoticeVO.setBusinessType(6); |
| | | sysUserNoticeVO.setBusinessContent("恭喜你,你已经通过了实名制认证"); |
| | | sysUserNoticeVO.setStatus(0); |
| | | sysUserNoticeVO.setBusinessStatus(2); |
| | | R r1 = userService.addNotice(sysUserNoticeVO); |
| | | if (R.isOk(r1)) { |
| | | log.info("新增实名认证未通过通知成功【{}】", JSONObject.toJSONString(sysUserNoticeVO)); |
| | | } |
| | | } else { |
| | | //未通过发通知 |
| | | /** |
| | | SysUserNoticeVO sysUserNoticeVO=new SysUserNoticeVO(); |
| | | sysUserNoticeVO.setUserId(userId); |
| | | sysUserNoticeVO.setType(3); |
| | | sysUserNoticeVO.setTitle("实名制审核未通过"); |
| | | sysUserNoticeVO.setBusinessType(6); |
| | | // sysUserNoticeVO.setBusinessTitle(comActActivityVO.getActivityName()); |
| | | sysUserNoticeVO.setBusinessContent(String.format("驳回原因:%s",r.getMsg())); |
| | | // sysUserNoticeVO.setBusinessId(activityId);R |
| | | sysUserNoticeVO.setStatus(0); |
| | | sysUserNoticeVO.setBusinessStatus(1); |
| | | R r1 = userService.addNotice(sysUserNoticeVO); |
| | | if (R.isOk(r1)) { |
| | | log.info("新增实名认证未通过通知成功【{}】", JSONObject.toJSONString(sysUserNoticeVO)); |
| | | } |
| | | */ |
| | | } |
| | | return r; |
| | | } |
| | |
| | | Long userId = this.getUserId(); |
| | | loginUserInfoVO.setUserId(userId); |
| | | return userService.putUser(loginUserInfoVO); |
| | | } |
| | | |
| | | @ApiOperation(value = "修改用户首页活动提示") |
| | | @PostMapping("editUserTips") |
| | | public R putUserTips(@RequestBody SysUserEditTipsDTO userEditTipsDTO) { |
| | | Long userId = this.getUserId(); |
| | | if(userId == null){ |
| | | return R.fail("请重新登录"); |
| | | } |
| | | userEditTipsDTO.setUserId(userId); |
| | | return userService.editUserTips(userEditTipsDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "房屋地址下拉列表") |
| | |
| | | return partyBuildingService.userCertification(userId); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "获取用户电子档案",response = UserArchivesVO.class) |
| | | @PostMapping("getUserArchives") |
| | | public R getUserArchives() { |
| | | Long userId = this.getUserId(); |
| | | if(userId == null){ |
| | | return R.fail("请重新登录"); |
| | | } |
| | | return userService.getUserArchives(userId); |
| | | } |
| | | |
| | | @ApiOperation(value = "编辑用户电子档案") |
| | | @PostMapping("updateUserArchives") |
| | | public R updateUserArchives(@RequestBody UpdateUserArchivesVO userArchivesVO) { |
| | | Long userId = this.getUserId(); |
| | | if(userId == null){ |
| | | return R.fail("请重新登录"); |
| | | } |
| | | userArchivesVO.setUserId(userId); |
| | | return userService.updateUserArchives(userArchivesVO); |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.applets.api; |
| | | |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.dtos.community.PageActWorkGuideDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.ComActWorkGuideVO; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * @auther llming |
| | | * @describe 办事指南API |
| | | */ |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/workguide/") |
| | | @Api(tags = {"办事指南API"}) |
| | | public class WorkGuideApi extends BaseController { |
| | | @Resource |
| | | private CommunityService communityService; |
| | | |
| | | @ApiOperation(value = "办事指南_分页",response = ComActWorkGuideVO.class) |
| | | @PostMapping("pageworkguide") |
| | | public R detailWorkGuide(@RequestBody PageActWorkGuideDTO pageActWorkGuideDTO) { |
| | | return communityService.pageWorkGuide(pageActWorkGuideDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "办事指南_详情",response = ComActWorkGuideVO.class) |
| | | @GetMapping("detailworkguide") |
| | | public R detailWorkGuide(@RequestParam("workGuideId")Long workGuideId) { |
| | | return communityService.detailWorkGuide(workGuideId); |
| | | } |
| | | } |
| | | |
New file |
| | |
| | | package com.panzhihua.applets.api; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.panzhihua.common.model.dtos.shop.WxPayNotifyOrderDTO; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | import com.panzhihua.common.utlis.StringUtils; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.json.XML; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | | import java.io.PrintWriter; |
| | | |
| | | /** |
| | | * @auther lyq |
| | | * @create 2021-04-14 15:02:49 |
| | | * @describe 微信支付回到函数 |
| | | */ |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/wx/") |
| | | public class WxCallbackApi { |
| | | |
| | | @Resource |
| | | private CommunityService communityService; |
| | | |
| | | @PostMapping("wxNotify") |
| | | public void payCallback(HttpServletRequest request, HttpServletResponse response) { |
| | | log.info("微信支付回调start"); |
| | | String inputLine = ""; |
| | | String notityXml = ""; |
| | | try { |
| | | while((inputLine = request.getReader().readLine()) != null){ |
| | | notityXml += inputLine; |
| | | } |
| | | //关闭流 |
| | | request.getReader().close(); |
| | | log.info("微信回调内容信息:"+notityXml); |
| | | //解析成Json |
| | | org.json.JSONObject xmlJson = XML.toJSONObject(notityXml); |
| | | if(StringUtils.isNotEmpty(xmlJson.toString())){ |
| | | JSONObject resultData = JSON.parseObject(xmlJson.get("xml").toString()); |
| | | //成功支付订单 |
| | | if(resultData.getString("result_code").equals("SUCCESS") && resultData.getString("return_code").equals("SUCCESS")){ |
| | | WxPayNotifyOrderDTO notifyOrderDTO = new WxPayNotifyOrderDTO(); |
| | | //订单号 |
| | | String orderTradeNo = resultData.getString("out_trade_no"); |
| | | notifyOrderDTO.setOrderTradeNo(orderTradeNo); |
| | | //微信支付订单号 |
| | | String wxTradeNo = resultData.getString("transaction_id"); |
| | | notifyOrderDTO.setWxTradeNo(wxTradeNo); |
| | | //订单金额 |
| | | String totalFee = resultData.getString("total_fee"); |
| | | notifyOrderDTO.setTotalFee(totalFee); |
| | | //支付完成时间 |
| | | String payTime = resultData.getString("time_end"); |
| | | notifyOrderDTO.setPayTime(payTime); |
| | | //现金支付金额 |
| | | String cashFee = resultData.getString("cash_fee"); |
| | | notifyOrderDTO.setCashFee(cashFee); |
| | | |
| | | //根据订单号修改订单信息 |
| | | communityService.wxOrderPayNotify(notifyOrderDTO); |
| | | |
| | | //封装 返回值 |
| | | StringBuffer buffer = new StringBuffer(); |
| | | buffer.append("<xml>"); |
| | | buffer.append("<return_code>SUCCESS</return_code>"); |
| | | buffer.append("<return_msg>OK</return_msg>"); |
| | | buffer.append("</xml>"); |
| | | |
| | | //给微信服务器返回 成功标示 否则会一直询问 咱们服务器 是否回调成功 |
| | | PrintWriter writer = response.getWriter(); |
| | | //返回 |
| | | writer.print(buffer.toString()); |
| | | }else{//未成功支付订单 |
| | | //封装 返回值 |
| | | StringBuffer buffer = new StringBuffer(); |
| | | buffer.append("<xml>"); |
| | | buffer.append("<return_code>FAIL</return_code>"); |
| | | buffer.append("<return_msg>FAIL</return_msg>"); |
| | | buffer.append("</xml>"); |
| | | |
| | | //给微信服务器返回 成功标示 否则会一直询问 咱们服务器 是否回调成功 |
| | | PrintWriter writer = response.getWriter(); |
| | | //返回 |
| | | writer.print(buffer.toString()); |
| | | } |
| | | } |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.applets.api; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.panzhihua.common.utlis.StringUtils; |
| | | import com.panzhihua.common.utlis.WxUtil; |
| | | import com.panzhihua.common.utlis.WxXCXTempSend; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.PrintWriter; |
| | | import java.security.MessageDigest; |
| | | import java.security.NoSuchAlgorithmException; |
| | | import java.util.Arrays; |
| | | |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/wx/push/") |
| | | public class WxMessagePushApi { |
| | | |
| | | private String token = "01A9CB2234D7CBD0AC61B75EB1263805"; |
| | | |
| | | private String url = "www.taobao.com";//图文跳转地址 |
| | | |
| | | private String thumbUrl = "https://www.psciio.com//idcard/f986ba3ae7a241d9bce5cb568adec7da.jpg";//图片地址 |
| | | |
| | | @Resource |
| | | private WxXCXTempSend wxXCXTempSend; |
| | | |
| | | /** |
| | | * 微信接口配置信息认证接口<br> |
| | | * 需要正确响应微信发送的Token验证。 加密/校验流程如下:<br> |
| | | * 1. 将token、timestamp、nonce三个参数进行字典序排序<br> |
| | | * 2. 将三个参数字符串拼接成一个字符串进行sha1加密<br> |
| | | * 3. 开发者获得加密后的字符串可与signature对比,标识该请求来源于微信 |
| | | */ |
| | | @RequestMapping("/cgi") |
| | | public void cgi(HttpServletRequest request, HttpServletResponse response) { |
| | | boolean isGet = request.getMethod().toLowerCase().equals("get"); |
| | | // 微信加密签名,signature结合了开发者填写的token参数和请求中的timestamp参数、nonce参数。 |
| | | try { |
| | | if (isGet) { |
| | | String signature = request.getParameter("signature"); |
| | | // 时间戳 |
| | | String timestamp = request.getParameter("timestamp"); |
| | | // 随机数 |
| | | String nonce = request.getParameter("nonce"); |
| | | // 随机字符串 |
| | | String echostr = request.getParameter("echostr"); |
| | | log.info("signature = "+signature+" , timestamp = "+timestamp+ " , nonce = "+nonce+ " , echostr = "+echostr); |
| | | String[] strArray = new String[] { token, timestamp, nonce }; |
| | | Arrays.sort(strArray); |
| | | StringBuilder sb = new StringBuilder(); |
| | | for (String str : strArray) { |
| | | sb.append(str); |
| | | } |
| | | // SHA1签名生成 |
| | | MessageDigest md = MessageDigest.getInstance("SHA-1"); |
| | | md.update(sb.toString().getBytes()); |
| | | byte[] digest = md.digest(); |
| | | |
| | | StringBuffer hexstr = new StringBuffer(); |
| | | String shaHex = ""; |
| | | for (int i = 0; i < digest.length; i++) { |
| | | shaHex = Integer.toHexString(digest[i] & 0xFF); |
| | | if (shaHex.length() < 2) { |
| | | hexstr.append(0); |
| | | } |
| | | hexstr.append(shaHex); |
| | | } |
| | | |
| | | if (hexstr.toString().equals(signature)) { |
| | | response.getOutputStream().write(echostr.getBytes()); |
| | | } |
| | | |
| | | }else{ |
| | | // 进入POST聊天处理 |
| | | // 将请求、响应的编码均设置为UTF-8(防止中文乱码) |
| | | request.setCharacterEncoding("UTF-8"); |
| | | response.setCharacterEncoding("UTF-8"); |
| | | // 接收消息并返回消息 |
| | | String result = acceptMessage(request, response); |
| | | |
| | | // 响应消息 |
| | | PrintWriter out = response.getWriter(); |
| | | out.print(result); |
| | | out.close(); |
| | | } |
| | | } catch (Exception ex) { |
| | | log.error("微信帐号接口配置失败!", ex); |
| | | ex.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 接受到微信接口数据 |
| | | * @param request |
| | | * @param response |
| | | * @return |
| | | */ |
| | | private String acceptMessage(HttpServletRequest request, HttpServletResponse response) { |
| | | String respMessage = ""; |
| | | String inputLine = ""; |
| | | String notityXml = ""; |
| | | try { |
| | | //接收数据 |
| | | while((inputLine = request.getReader().readLine()) != null){ |
| | | notityXml += inputLine; |
| | | } |
| | | |
| | | // xml请求解析 |
| | | JSONObject requestJson = JSON.parseObject(notityXml); |
| | | log.info(">>>>>>>>>>>>>"+requestJson.toString()); |
| | | // 发送方帐号(open_id) |
| | | String fromUserName = requestJson.get("FromUserName").toString(); |
| | | // 公众帐号 |
| | | String toUserName = requestJson.get("ToUserName").toString(); |
| | | // 消息类型 |
| | | String msgType = requestJson.get("MsgType").toString(); |
| | | // String Event = requestJson.get("Event").toString(); //SCAN 为扫描信息 VIEW 公众号底部点击事件 |
| | | log.info("fromUserName = "+fromUserName+" , ToUserName = "+toUserName+ " , msgType = "+msgType); |
| | | |
| | | String access_token = wxXCXTempSend.getAccessToken();//获取access_token |
| | | |
| | | //公众号关注事件消息 |
| | | if(msgType.equals("event")){ |
| | | // log.info("公众号被关注事件.........."); |
| | | }else if(msgType.equals("text")){ |
| | | // if(StringUtils.isNotEmpty(access_token)){ |
| | | // String mediaId = wxXCXTempSend.getMediaId(access_token);//获取mediaId |
| | | // WxUtil.sendKfImagesMessage(fromUserName,access_token,mediaId); |
| | | // } |
| | | // log.info("公众号接受文字.........."); |
| | | }else if(msgType.equals("image")){ |
| | | // log.info("公众号接受图片.........."); |
| | | }else if(msgType.equals("miniprogrampage")){ |
| | | if(StringUtils.isNotEmpty(access_token)){ |
| | | String mediaId = wxXCXTempSend.getMediaId(access_token);//获取mediaId |
| | | WxUtil.sendKfImagesMessage(fromUserName,access_token,mediaId); |
| | | } |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return respMessage; |
| | | } |
| | | |
| | | } |
| | |
| | | * 消息格式,XML或者JSON |
| | | */ |
| | | private String msgDataFormat; |
| | | |
| | | /** |
| | | * 商户号 |
| | | */ |
| | | private String mchId; |
| | | |
| | | /** |
| | | * 微信支付密钥 |
| | | */ |
| | | private String payKey; |
| | | |
| | | /** |
| | | * 微信支付回调地址 |
| | | */ |
| | | private String notifyUrl; |
| | | } |
| | |
| | | max-file-size: 10MB |
| | | max-request-size: 10MB |
| | | |
| | | server: |
| | | max-http-header-size: 10MB |
| | | |
| | | eureka: |
| | | client: |
| | | service-url: |
| | |
| | | package com.panzhihua.applets_backstage.api; |
| | | |
| | | import com.alibaba.excel.EasyExcel; |
| | | import com.alibaba.excel.ExcelWriter; |
| | | import com.alibaba.excel.write.metadata.WriteSheet; |
| | | import com.alibaba.excel.write.style.column.LongestMatchColumnWidthStyleStrategy; |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.panzhihua.common.constants.Constants; |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.dtos.community.PageQuestnaireDTO; |
| | | import com.panzhihua.common.model.dtos.shop.PageComShopStoreDTO; |
| | | import com.panzhihua.common.excel.CustomSheetWriteHandler; |
| | | import com.panzhihua.common.interfaces.ShopOperLog; |
| | | import com.panzhihua.common.model.dtos.shop.*; |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.questnaire.QuestnaireListVo; |
| | | import com.panzhihua.common.model.vos.shop.ComShopStoreVO; |
| | | import com.panzhihua.common.model.vos.shop.ShopStoreVO; |
| | | import com.panzhihua.common.model.vos.shop.*; |
| | | import com.panzhihua.common.model.vos.user.AdministratorsUserVO; |
| | | import com.panzhihua.common.model.vos.user.ChangePasswordVO; |
| | | import com.panzhihua.common.model.vos.user.SysUserVO; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | import com.panzhihua.common.service.user.UserService; |
| | | import com.panzhihua.common.utlis.ClazzUtils; |
| | | import com.panzhihua.common.utlis.SFTPUtil; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.validation.Valid; |
| | | import javax.validation.constraints.NotNull; |
| | | import java.io.File; |
| | | import java.io.FileInputStream; |
| | | import java.io.InputStream; |
| | | import java.net.URLEncoder; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.UUID; |
| | | |
| | | /** |
| | | * @auther llming |
| | |
| | | @Api(tags = {"商城管理模块"}) |
| | | @RestController("/shop") |
| | | public class ShopApi extends BaseController { |
| | | @Value("${excel.userurl}") |
| | | private String excelUrl; |
| | | // FTP 登录用户名 |
| | | @Value("${ftp.username}") |
| | | private String userName; |
| | | // FTP 登录密码 |
| | | @Value("${ftp.password}") |
| | | private String password; |
| | | // FTP 服务器地址IP地址 |
| | | @Value("${ftp.host}") |
| | | private String host; |
| | | // FTP 端口 |
| | | @Value("${ftp.port}") |
| | | private int port; |
| | | @Resource |
| | | private CommunityService communityService; |
| | | @Resource |
| | | private UserService userService; |
| | | |
| | | @ApiOperation(value = "分页查询商家", response = ComShopStoreVO.class) |
| | | @PostMapping("/page") |
| | | @ApiOperation(value = "分页查询商家", response = PageShopStoreVO.class) |
| | | @PostMapping("/store/page") |
| | | public R pageVolunteer(@RequestBody PageComShopStoreDTO pageComShopStoreDTO) { |
| | | return communityService.pageStoreList(pageComShopStoreDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "保存商家") |
| | | @PostMapping("/save") |
| | | @PostMapping("/store/save") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R saveStore(@Valid @RequestBody ShopStoreVO storeVO) { |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); |
| | | Long loginUserId = loginUserInfo.getUserId(); |
| | | if (storeVO == null) { |
| | | return R.fail(); |
| | | } |
| | | R<SysUserVO> sysUserVO = userService.getSysUserVOByPhone(storeVO.getPhone()); |
| | | JSONObject jsonObject = JSON.parseObject(JSON.toJSONString(sysUserVO.getData())); |
| | | SysUserVO entityVo = jsonObject.toJavaObject(SysUserVO.class); |
| | | storeVO.setSysUserId(entityVo.getUserId()); |
| | | storeVO.setLoginUserId(loginUserId); |
| | | R r1 = communityService.saveStore(storeVO); |
| | | //保存sys_user |
| | | if (R.isOk(r1)) { |
| | | AdministratorsUserVO administratorsUserVO = new AdministratorsUserVO(); |
| | | administratorsUserVO.setAccount(storeVO.getStoreAccount()); |
| | | administratorsUserVO.setPassword(storeVO.getStorePassword()); |
| | | administratorsUserVO.setType(5); |
| | | administratorsUserVO.setAreaId(null); |
| | | administratorsUserVO.setStatus(1); |
| | | administratorsUserVO.setPhone(storeVO.getPhone()); |
| | | administratorsUserVO.setRoleId(888888888l); |
| | | administratorsUserVO.setShopStoreName(storeVO.getName()); |
| | | administratorsUserVO.setShopStorePhone(storeVO.getPhone()); |
| | | R r = userService.addUserBackstage(administratorsUserVO); |
| | | //查询该手机号是否已注册到平台 |
| | | R isAddStore = communityService.addStore(storeVO); |
| | | if(isAddStore.getCode() != 200){ |
| | | return isAddStore; |
| | | } |
| | | R isAddSysUser = userService.addSysUser(storeVO); |
| | | if(isAddSysUser.getCode() != 200){ |
| | | return isAddSysUser; |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | @ApiOperation(value = "编辑商家、启用、禁用") |
| | | @PostMapping("/edit/{id}") |
| | | @ApiImplicitParam(name = "id", value = "商家id") |
| | | public R editStore(@Valid @RequestBody ShopStoreVO storeVO, @PathVariable("id") Long id) { |
| | | R<LoginUserInfoVO> sysUserVO = userService.getUserInfoByUserId(storeVO.getSysUserId() + ""); |
| | | // @ApiOperation(value = "编辑商家、启用、禁用") |
| | | @PostMapping("/storebak/edit/{id}") |
| | | // @ApiImplicitParam(name = "id", value = "商家id") |
| | | public R editStoreBak(@Valid @RequestBody ShopStoreVO storeVO, @PathVariable("id") Long id) { |
| | | R<LoginUserInfoVO> sysUserVO = userService.getSysUserVOByAccountAndType(storeVO.getStoreAccount(),5); |
| | | if (sysUserVO.getData() == null) { |
| | | return R.fail("没有相关的用户!"); |
| | | } |
| | | |
| | | LoginUserInfoVO user = JSON.parseObject(JSON.toJSONString(sysUserVO.getData())).toJavaObject(LoginUserInfoVO.class); |
| | | storeVO.setSysUserId(user.getUserId()); |
| | | |
| | | R<ShopStoreVO> storeInfoVO = communityService.getStoreInfo(id); |
| | | if( storeInfoVO.getCode()==500){ |
| | | if (storeInfoVO.getCode() == 500) { |
| | | return R.fail(storeInfoVO.getMsg()); |
| | | } |
| | | //维护sys_user |
| | | ShopStoreVO shopStoreVO = JSON.parseObject(JSON.toJSONString(storeInfoVO.getData())).toJavaObject(ShopStoreVO.class); |
| | | ChangePasswordVO changePasswordVO = new ChangePasswordVO(); |
| | | changePasswordVO.setOldPassword(shopStoreVO.getStorePassword()); |
| | | changePasswordVO.setUserId(user.getUserId()); |
| | | changePasswordVO.setNewPassword(storeVO.getStorePassword()); |
| | | R r = userService.changePassword(changePasswordVO); |
| | | if (R.isOk(r)) { |
| | | if (R.isOk(r)||r.getMsg().equals("新密码与原密码不能相同")){ |
| | | return communityService.editStore(storeVO, id); |
| | | } |
| | | return R.fail(); |
| | | } |
| | | |
| | | @ApiOperation(value = "编辑商家、启用、禁用") |
| | | @PostMapping("/store/edit/{id}") |
| | | @ApiImplicitParam(name = "id", value = "商家id") |
| | | public R editStore(@Valid @RequestBody ShopStoreVO storeVO, @PathVariable("id") Long id) { |
| | | //判断参数 |
| | | if(storeVO == null || id == null){ |
| | | return R.fail("参数错误"); |
| | | } |
| | | storeVO.setId(id); |
| | | //修改店铺信息 |
| | | R editStore = communityService.editStore(storeVO, id); |
| | | if(editStore == null || editStore.getCode() != Constants.SUCCESS){ |
| | | return editStore; |
| | | } |
| | | //修改SysUser信息 |
| | | R editUser = userService.editSysUser(storeVO); |
| | | if(editUser == null || editUser.getCode() != Constants.SUCCESS){ |
| | | return editUser; |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | @ApiOperation(value = "删除商家") |
| | | @PostMapping("/delete") |
| | | @PostMapping("/store/delete") |
| | | public R delete(@RequestBody Long[] ids) { |
| | | return communityService.deleteStore(ids); |
| | | } |
| | | |
| | | @ApiOperation(value = "分页查询商品", response = PageShopGoodsVO.class) |
| | | @PostMapping("/goods/page") |
| | | public R pageGoodsList(@RequestBody PageComShopGoodsDTO pageComShopGoodsDTO) { |
| | | return communityService.pageGoodsList(pageComShopGoodsDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "新增商品") |
| | | @PostMapping("/goods/save") |
| | | R saveShopGoods(@RequestBody AddShopGoodsVO addShopGoodsVO) { |
| | | return communityService.saveShopGoods(addShopGoodsVO); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "编辑商品") |
| | | @PostMapping("/goods/edit/{id}") |
| | | R editShopGoods(@PathVariable("id") Long id, @RequestBody AddShopGoodsVO addShopGoodsVO) { |
| | | return communityService.editShopGoods(id, addShopGoodsVO); |
| | | } |
| | | |
| | | @ApiOperation(value = "删除商品") |
| | | @PostMapping("/goods/delete") |
| | | R deleteShopGoods(@RequestBody Long[] id) { |
| | | return communityService.deleteShopGoods(id); |
| | | } |
| | | |
| | | @ApiOperation(value = "商品上下架") |
| | | @ApiImplicitParams({@ApiImplicitParam(name = "id", value = "商品Id"), |
| | | @ApiImplicitParam(name = "status", value = "1.上架 2.下架 ")}) |
| | | @GetMapping("/goods/changeStatus") |
| | | R changeStatus(@RequestParam("id") Long id, @RequestParam("status") Integer status) { |
| | | return communityService.changeStatus(id, status); |
| | | } |
| | | |
| | | @ApiOperation(value = "订单_分页列表", response = ComShopOrderSearchVO.class) |
| | | @PostMapping("/order/page") |
| | | public R page(@RequestBody @Validated PageComShopOrderSearchDTO pageComShopOrderSearchDTO) { |
| | | //pageComShopOrderSearchDTO.setUserId(this.getUserId()); |
| | | ClazzUtils.setIfStringIsEmpty(pageComShopOrderSearchDTO); |
| | | return communityService.pageShopOrder(pageComShopOrderSearchDTO); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "订单_详细", response = ComShopOrderPageVO.class) |
| | | @GetMapping("/order/detail") |
| | | @ShopOperLog(operType = 11) |
| | | public R detail(@RequestParam("orderId") Long orderId) { |
| | | return communityService.orderDetail(orderId); |
| | | } |
| | | |
| | | @ApiOperation(value = "订单_导出表格") |
| | | @PostMapping("/order/export") |
| | | @ShopOperLog(operType = 12) |
| | | public R export(@RequestBody ComShopOrderExportDTO comShopOrderExportDTO) { |
| | | ClazzUtils.setIfStringIsEmpty(comShopOrderExportDTO); |
| | | String url = excelUrl; |
| | | String uuid = UUID.randomUUID().toString().replace("-", ""); |
| | | //String name=uuid+".xlsx"; |
| | | String ftpUrl = "/mnt/data/web/excel/"; |
| | | |
| | | R r = communityService.shopOrderExportData(comShopOrderExportDTO); |
| | | if (R.isOk(r)) { |
| | | List<ExcelShopOrderDTO> excelShopOrderDTO = JSONArray.parseArray(JSONArray.toJSONString(r.getData()), ExcelShopOrderDTO.class); |
| | | if (excelShopOrderDTO == null || excelShopOrderDTO.size() == 0) { |
| | | return R.ok("未找到数据"); |
| | | } |
| | | try { |
| | | SFTPUtil sftp = new SFTPUtil(userName, password, host, port); |
| | | sftp.login(); |
| | | String name = "商城订单-" + new SimpleDateFormat("yyyyMMddhhmmss").format(new Date()) + ".xlsx"; |
| | | boolean existDir = sftp.isExistDir(ftpUrl + name); |
| | | if (!existDir) { |
| | | String property = System.getProperty("user.dir"); |
| | | String fileName = property + File.separator + name; |
| | | // 这里 需要指定写用哪个class去写 |
| | | ExcelWriter excelWriter = null; |
| | | InputStream inputStream = null; |
| | | try { |
| | | excelWriter = EasyExcel.write(fileName, ExcelShopOrderDTO.class).registerWriteHandler(new LongestMatchColumnWidthStyleStrategy()).registerWriteHandler(new CustomSheetWriteHandler()).build(); |
| | | WriteSheet writeSheet = EasyExcel.writerSheet("订单").build(); |
| | | excelWriter.write(excelShopOrderDTO, writeSheet); |
| | | excelWriter.finish(); |
| | | File file = new File(fileName); |
| | | inputStream = new FileInputStream(file); |
| | | sftp.uploadMore(ftpUrl, name, inputStream); |
| | | sftp.logout(); |
| | | inputStream.close(); |
| | | String absolutePath = file.getAbsolutePath(); |
| | | boolean delete = file.delete(); |
| | | log.info("删除excel【{}】结果【{}】", absolutePath, delete); |
| | | } finally { |
| | | // 千万别忘记finish 会帮忙关闭流 |
| | | if (inputStream != null) { |
| | | inputStream.close(); |
| | | } |
| | | if (excelWriter != null) { |
| | | excelWriter.finish(); |
| | | } |
| | | } |
| | | } |
| | | return R.ok(url + URLEncoder.encode(name, "UTF-8")); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | log.error("文件传输失败【{}】", e.getMessage()); |
| | | return R.fail(); |
| | | } |
| | | } |
| | | return R.fail("导出数据失败"); |
| | | } |
| | | |
| | | @ApiOperation(value = "资金_统计信息") |
| | | @GetMapping("/capital/stat") |
| | | public R stat() { |
| | | Long userId = 0L; |
| | | return communityService.getFundsStat(userId); |
| | | } |
| | | |
| | | @ApiOperation(value = "资金_分页列表") |
| | | @PostMapping("/capital/page") |
| | | public R page(@RequestBody PageComShopFundsSearchDTO pageComShopFundsSearchDTO) { |
| | | pageComShopFundsSearchDTO.setUserId(getUserId()); |
| | | ClazzUtils.setIfStringIsEmpty(pageComShopFundsSearchDTO); |
| | | return communityService.pageShopFunds(pageComShopFundsSearchDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "资金_详情", response = CapitalDetailVO.class) |
| | | @ApiImplicitParam(name = "orderId", value = "订单Id") |
| | | @GetMapping("/capital/capitalDetailByStore") |
| | | R capitalDetailByStore(@RequestParam("orderId") Long orderId) { |
| | | return communityService.capitalDetailByStore(orderId); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "资金_导出表格") |
| | | @PostMapping("/capital/export") |
| | | @ShopOperLog(operType = 12) |
| | | public R export(@RequestBody ComShopFundsExportDTO comShopFundsExportDTO) { |
| | | ClazzUtils.setIfStringIsEmpty(comShopFundsExportDTO); |
| | | String url = excelUrl; |
| | | String uuid = UUID.randomUUID().toString().replace("-", ""); |
| | | //String name=uuid+".xlsx"; |
| | | String ftpUrl = "/mnt/data/web/excel/"; |
| | | |
| | | Long userId = this.getUserId(); |
| | | comShopFundsExportDTO.setUserId(userId); |
| | | R r = communityService.shopOrderFundsExportData(comShopFundsExportDTO); |
| | | if (R.isOk(r)) { |
| | | List<ExcelShopFundsDTO> excelShopFundsDTO = JSONArray.parseArray(JSONArray.toJSONString(r.getData()), ExcelShopFundsDTO.class); |
| | | if (excelShopFundsDTO == null || excelShopFundsDTO.size() == 0) { |
| | | return R.ok("未找到数据"); |
| | | } |
| | | try { |
| | | SFTPUtil sftp = new SFTPUtil(userName, password, host, port); |
| | | sftp.login(); |
| | | String name = "商家资金流水-" + new SimpleDateFormat("yyyyMMddhhmmss").format(new Date()) + ".xlsx"; |
| | | boolean existDir = sftp.isExistDir(ftpUrl + name); |
| | | if (!existDir) { |
| | | String property = System.getProperty("user.dir"); |
| | | String fileName = property + File.separator + name; |
| | | // 这里 需要指定写用哪个class去写 |
| | | ExcelWriter excelWriter = null; |
| | | InputStream inputStream = null; |
| | | try { |
| | | excelWriter = EasyExcel.write(fileName, ExcelShopFundsDTO.class).registerWriteHandler(new LongestMatchColumnWidthStyleStrategy()).registerWriteHandler(new CustomSheetWriteHandler()).build(); |
| | | WriteSheet writeSheet = EasyExcel.writerSheet("订单").build(); |
| | | excelWriter.write(excelShopFundsDTO, writeSheet); |
| | | excelWriter.finish(); |
| | | File file = new File(fileName); |
| | | inputStream = new FileInputStream(file); |
| | | sftp.uploadMore(ftpUrl, name, inputStream); |
| | | sftp.logout(); |
| | | inputStream.close(); |
| | | String absolutePath = file.getAbsolutePath(); |
| | | boolean delete = file.delete(); |
| | | log.info("删除excel【{}】结果【{}】", absolutePath, delete); |
| | | } finally { |
| | | // 千万别忘记finish 会帮忙关闭流 |
| | | if (inputStream != null) { |
| | | inputStream.close(); |
| | | } |
| | | if (excelWriter != null) { |
| | | excelWriter.finish(); |
| | | } |
| | | } |
| | | } |
| | | return R.ok(url + URLEncoder.encode(name, "UTF-8")); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | log.error("文件传输失败【{}】", e.getMessage()); |
| | | return R.fail(); |
| | | } |
| | | } |
| | | return R.fail("导出数据失败"); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "配送完成") |
| | | @PutMapping("/order/finishDeliver") |
| | | public R finishDeliver(@RequestBody ComShopOrderDeliverDTO deliverDTO){ |
| | | deliverDTO.setOperUserAccount(getLoginUserInfo().getPhone()); |
| | | deliverDTO.setIsAdmin(true); |
| | | return communityService.finishDeliverOrder(deliverDTO); |
| | | } |
| | | } |
| | |
| | | **/ |
| | | @Api(tags = {"用户模块"}) |
| | | @RestController |
| | | @RequestMapping("/user/")public class UserApi extends BaseController { |
| | | @RequestMapping("/user/") |
| | | public class UserApi extends BaseController { |
| | | @Resource |
| | | private UserService userService; |
| | | @ApiOperation(value = "当前登录用户信息",response = LoginUserInfoVO.class) |
New file |
| | |
| | | package com.panzhihua.applets_backstage.api; |
| | | |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.dtos.community.PageActWorkGuideDTO; |
| | | import com.panzhihua.common.model.dtos.community.PageComStreetDTO; |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.ComActWorkGuideVO; |
| | | import com.panzhihua.common.model.vos.community.ComStreetVO; |
| | | import com.panzhihua.common.model.vos.user.AdministratorsUserVO; |
| | | import com.panzhihua.common.model.vos.user.SysUserVO; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | import com.panzhihua.common.service.user.UserService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @description: 办事指南管理 |
| | | * @author: llming |
| | | **/ |
| | | @RestController |
| | | @RequestMapping("/workguidemanager/") |
| | | @Api(tags = {"办事指南管理"}) |
| | | public class WorkGuideApi extends BaseController { |
| | | @Resource |
| | | private CommunityService communityService; |
| | | |
| | | |
| | | @ApiOperation(value = "办事指南_新增") |
| | | @PostMapping("addworkguide") |
| | | public R addStreet(@RequestBody ComActWorkGuideVO workGuideVO) { |
| | | LoginUserInfoVO loginUserInfo = getLoginUserInfo(); |
| | | return communityService.addWorkGuide(workGuideVO,loginUserInfo.getUserId()); |
| | | } |
| | | |
| | | |
| | | @PostMapping("editworkguide") |
| | | @ApiOperation(value = "办事指南_编辑") |
| | | public R putWorkGuide(@RequestBody ComActWorkGuideVO workGuideVO) { |
| | | LoginUserInfoVO loginUserInfo = getLoginUserInfo(); |
| | | return communityService.editWorkGuide(workGuideVO,loginUserInfo.getUserId()); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "办事指南_详情",response = ComActWorkGuideVO.class) |
| | | @GetMapping("detailworkguide") |
| | | public R detailWorkGuide(@RequestParam("workGuideId")Long workGuideId) { |
| | | return communityService.detailWorkGuide(workGuideId); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "办事指南_分页",response = ComActWorkGuideVO.class) |
| | | @PostMapping("pageworkguide") |
| | | public R detailWorkGuide(@RequestBody PageActWorkGuideDTO pageActWorkGuideDTO) { |
| | | return communityService.pageWorkGuide(pageActWorkGuideDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "办事指南_删除",response = ComActWorkGuideVO.class) |
| | | @PostMapping("delectworkguide") |
| | | R delectWorkGuide(@RequestParam("workGuideId") Long workGuideId){ |
| | | return communityService.delectWorkGuide(workGuideId); |
| | | } |
| | | |
| | | } |
| | |
| | | return R.ok(loginReturnVO); |
| | | } |
| | | |
| | | /** |
| | | * 商家后台登录 |
| | | * @param account 账户 |
| | | * @param password 密码 |
| | | * @return 登录结果 |
| | | */ |
| | | @PostMapping("/loginShopBackStage") |
| | | public R loginShopBackStage(@RequestParam("account") String account, @RequestParam("password")String password){ |
| | | LoginReturnVO loginReturnVO =loginService.loginShopBackStage(account,password); |
| | | return R.ok(loginReturnVO); |
| | | } |
| | | |
| | | } |
| | |
| | | * @return 登录结果 |
| | | */ |
| | | LoginReturnVO loginCommunityBackage(String account, String password); |
| | | |
| | | /** |
| | | * 商家后台登录 |
| | | * @param account 账户 |
| | | * @param password 密码 |
| | | * @return 登录结果 |
| | | */ |
| | | LoginReturnVO loginShopBackStage(String account, String password); |
| | | } |
| | |
| | | return loginReturnVO; |
| | | } |
| | | |
| | | /** |
| | | * 商家后台登录 |
| | | * |
| | | * @param account 账户 |
| | | * @param password 密码 |
| | | * @return 登录结果 |
| | | */ |
| | | @Override |
| | | public LoginReturnVO loginShopBackStage(String account, String password) { |
| | | Authentication authentication = null; |
| | | authentication = authenticationManager |
| | | .authenticate(new UsernamePasswordAuthenticationToken(account+"_5", password)); |
| | | LoginUserInfoVO loginUser = (LoginUserInfoVO) authentication.getPrincipal(); |
| | | String token = JWTTokenUtil.generateToken(loginUser); |
| | | String refeshToken = JWTTokenUtil.generateRefeshToken(loginUser); |
| | | LoginReturnVO loginReturnVO=new LoginReturnVO(); |
| | | loginReturnVO.setToken(token); |
| | | loginReturnVO.setRefreshToken(refeshToken); |
| | | return loginReturnVO; |
| | | } |
| | | |
| | | } |
| | |
| | | <groupId>org.apache.httpcomponents</groupId> |
| | | <artifactId>httpclient</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.jdom</groupId> |
| | | <artifactId>jdom2</artifactId> |
| | | <version>2.0.5</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.json</groupId> |
| | | <artifactId>json</artifactId> |
| | | <version>20160810</version> |
| | | </dependency> |
| | | <!-- https://mvnrepository.com/artifact/commons-codec/commons-codec --> |
| | | <dependency> |
| | | <groupId>commons-codec</groupId> |
| | | <artifactId>commons-codec</artifactId> |
| | | <version>1.9</version> |
| | | </dependency> |
| | | |
| | | </dependencies> |
| | | |
| | | |
| | |
| | | public static final String REPEAT_SUBMIT_KEY = "repeat_submit:"; |
| | | |
| | | public static final String AES_KEY="35^*M@dp$5xDB&P@"; |
| | | |
| | | /** |
| | | * 商户平台默认角色权限默认字符串 |
| | | */ |
| | | public static final String SHOP_ROLE_KEY="shanghupingtai"; |
| | | /** |
| | | * 商户平台超级管理员权限默认字符串 |
| | | */ |
| | | public static final String ADMIN_SHOP_ROLE_KEY="chaojiguanliyuan"; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.constants; |
| | | |
| | | /** |
| | | * 微信支付通用常量 |
| | | * |
| | | * @author LYQ |
| | | */ |
| | | public class PayCpmstant { |
| | | |
| | | //微信支付统一下单url地址 |
| | | public static final String UNIFIEDORDER_URL="https://api.mch.weixin.qq.com/pay/unifiedorder"; |
| | | //微信支付默认编码格式 |
| | | public static final String DEFAULT_ENCODING="UTF-8"; |
| | | //微信支付返回支付成功CODE |
| | | public static final String RETURN_CODE="SUCCESS"; |
| | | //微信支付返回支付成功MSG |
| | | public static final String RETURN_MSG="OK"; |
| | | //微信支付默认加密格式 |
| | | public static final String SIGN_TYPE="MD5"; |
| | | } |
| | |
| | | public static final String ROLE_ALL="springsecurity:role:all";//平台所有权限存储在redis |
| | | public static final String ROLE_USER="springsecurity:role:";//某个用户的具体权限 |
| | | public static final String ROLE_APPLETS="applets";//小程序用户通用角色 |
| | | public static final String APPLETS_ACCESS_TOKEN ="APPLETS_ACCESS_TOKEN";//小程序获取的access_token |
| | | public static final String APPLETS_ACCESS_TOKEN_TIME ="APPLETS_ACCESS_TOKEN_TIME";//小程序获取的access_token |
| | | public static final String APPLETS_ACCESS_MEDIA_ID ="APPLETS_ACCESS_MEDIA_ID";//小程序获取的access_token |
| | | public static final String APPLETS_ACCESS_MEDIA_ID_TIME ="APPLETS_ACCESS_MEDIA_ID_TIME";//小程序获取的access_token |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.enums; |
| | | |
| | | import lombok.Getter; |
| | | |
| | | /** |
| | | * 建筑类型 |
| | | * |
| | | * @author llming |
| | | */ |
| | | @Getter |
| | | public enum RealAssetsCategoryType |
| | | { |
| | | PUBLIC(2, "公共设施"), BUILD(1, "建筑类"); |
| | | |
| | | private final int code; |
| | | private final String info; |
| | | |
| | | RealAssetsCategoryType(int code, String info) |
| | | { |
| | | this.code = code; |
| | | this.info = info; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.excel; |
| | | |
| | | import com.alibaba.excel.write.handler.SheetWriteHandler; |
| | | import com.alibaba.excel.write.metadata.holder.WriteSheetHolder; |
| | | import com.alibaba.excel.write.metadata.holder.WriteWorkbookHolder; |
| | | import org.apache.poi.ss.usermodel.DataValidation; |
| | | import org.apache.poi.ss.usermodel.DataValidationConstraint; |
| | | import org.apache.poi.ss.usermodel.DataValidationHelper; |
| | | import org.apache.poi.ss.util.CellRangeAddressList; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | |
| | | /** |
| | | * 自定义拦截器.对第一列第一行和第二行的数据新增下拉框,显示 测试1 测试2 |
| | | * |
| | | * @author Jiaju Zhuang |
| | | */ |
| | | public class CustomSheetWriteHandler implements SheetWriteHandler { |
| | | |
| | | private static final Logger LOGGER = LoggerFactory.getLogger(CustomSheetWriteHandler.class); |
| | | |
| | | @Override |
| | | public void beforeSheetCreate(WriteWorkbookHolder writeWorkbookHolder, WriteSheetHolder writeSheetHolder) { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void afterSheetCreate(WriteWorkbookHolder writeWorkbookHolder, WriteSheetHolder writeSheetHolder) { |
| | | LOGGER.info("第{}个Sheet写入成功。", writeSheetHolder.getSheetNo()); |
| | | |
| | | // 区间设置 第一列第一行和第二行的数据。由于第一行是头,所以第一、二行的数据实际上是第二三行 |
| | | CellRangeAddressList cellRangeAddressList = new CellRangeAddressList(1, 2000, 1, 1); |
| | | CellRangeAddressList cellRangeAddressList1 = new CellRangeAddressList(1, 2000, 3 ,3); |
| | | CellRangeAddressList cellRangeAddressList2 = new CellRangeAddressList(1, 2000, 10 ,10); |
| | | DataValidationHelper helper = writeSheetHolder.getSheet().getDataValidationHelper(); |
| | | DataValidationConstraint constraint = helper.createExplicitListConstraint(new String[] {"是", "否"}); |
| | | DataValidationConstraint constraint1 = helper.createExplicitListConstraint(new String[] {"中共党员","中共预备党员","共青团员","民革党员","民盟盟员","民建会员","农工党党员","致公党党员","九三学社社员","台盟盟员","无党派人士","群众"}); |
| | | DataValidationConstraint constraint2 = helper.createExplicitListConstraint(new String[] {"男", "女","未知"}); |
| | | DataValidation dataValidation = helper.createValidation(constraint2, cellRangeAddressList); |
| | | DataValidation dataValidation1 = helper.createValidation(constraint, cellRangeAddressList1); |
| | | DataValidation dataValidation2= helper.createValidation(constraint1, cellRangeAddressList2); |
| | | |
| | | writeSheetHolder.getSheet().addValidationData(dataValidation); |
| | | writeSheetHolder.getSheet().addValidationData(dataValidation1); |
| | | writeSheetHolder.getSheet().addValidationData(dataValidation2); |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.interfaces; |
| | | |
| | | import java.lang.annotation.*; |
| | | |
| | | /** |
| | | * 商城后台操作日志注解 |
| | | * @author wu |
| | | */ |
| | | @Target(ElementType.METHOD) //注解放置的目标位置,METHOD是可注解在方法级别上 |
| | | @Retention(RetentionPolicy.RUNTIME) //注解在哪个阶段执行 |
| | | @Documented |
| | | public @interface ShopOperLog { |
| | | String operModul() default "shop"; |
| | | /** |
| | | * 操作类型 |
| | | * 1.登录 |
| | | * 2.修改密码 |
| | | * 3.添加商品 |
| | | * 4.编辑商品 |
| | | * 5.下架商品 |
| | | * 6.上架商品 |
| | | * 7.删除商品 |
| | | * 8.取消订单 |
| | | * 9.发货 |
| | | * 10.配送 |
| | | * 11.查看订单详情 |
| | | * 12.导出订单 |
| | | * 13.导出资金流水 |
| | | * @return |
| | | */ |
| | | int operType() default 0; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.listen; |
| | | |
| | | import com.alibaba.excel.context.AnalysisContext; |
| | | import com.alibaba.excel.event.AnalysisEventListener; |
| | | import com.google.common.collect.Lists; |
| | | import com.panzhihua.common.enums.PopulIsOkEnum; |
| | | import com.panzhihua.common.enums.PopulPoliticalOutlookEnum; |
| | | import com.panzhihua.common.enums.PopulSexEnum; |
| | | import com.panzhihua.common.exceptions.ServiceException; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.ComMngPopulationServeExcelVO; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | import com.panzhihua.common.utlis.AgeUtils; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @description: 实有人口确认导入监听 |
| | | * @author: llming |
| | | */ |
| | | @Slf4j |
| | | public class ComMngPopulationConfirmServeExcelListen extends AnalysisEventListener<Map<Integer, String>> { |
| | | private CommunityService communityService; |
| | | |
| | | private Long communityId; |
| | | |
| | | private static int headSize = 0; |
| | | |
| | | private Map<Integer, String> headData; |
| | | |
| | | |
| | | public ComMngPopulationConfirmServeExcelListen(CommunityService communityService, Long communityId) { |
| | | this.communityService = communityService; |
| | | this.communityId = communityId; |
| | | } |
| | | |
| | | /** |
| | | * 每隔5条存储数据库,实际使用中可以3000条,然后清理list ,方便内存回收 |
| | | */ |
| | | private static final int BATCH_COUNT = 100; |
| | | List<Map<Integer, String>> list = new ArrayList<Map<Integer, String>>(); |
| | | |
| | | @Override |
| | | public void invoke(Map<Integer, String> data, AnalysisContext context) { |
| | | list.add(data); |
| | | if (list.size() >= BATCH_COUNT) { |
| | | saveData(); |
| | | list.clear(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 这里会一行行的返回头 |
| | | * |
| | | * @param headMap |
| | | * @param context |
| | | */ |
| | | @Override |
| | | public void invokeHeadMap(Map<Integer, String> headMap, AnalysisContext context) { |
| | | headSize = headMap.size(); |
| | | headData = headMap; |
| | | } |
| | | |
| | | @Override |
| | | public void doAfterAllAnalysed(AnalysisContext context) { |
| | | saveData(); |
| | | log.info("所有数据解析完成!"); |
| | | } |
| | | |
| | | /** |
| | | * 不是固定的列只能手动处理 |
| | | */ |
| | | private void saveData() { |
| | | int index = 2; |
| | | try { |
| | | ArrayList<ComMngPopulationServeExcelVO> voList = Lists.newArrayList(); |
| | | for (Map<Integer, String> oneData : list) { |
| | | ComMngPopulationServeExcelVO vo = new ComMngPopulationServeExcelVO(); |
| | | if(oneData.get(0) == null){ |
| | | throw new ServiceException("500", "名字不可为空:第" + index + "行,第1列"); |
| | | } |
| | | vo.setName(oneData.get(0)); |
| | | if(oneData.get(1) == null){ |
| | | throw new ServiceException("500", "身份证号不可为空:第" + index + "行,第2列"); |
| | | } |
| | | vo.setCardNo(oneData.get(1)); |
| | | //根据身份证号码解析年龄以及性别 |
| | | //获取用户生日 |
| | | String birthday = vo.getCardNo().substring(6, 14); |
| | | //设置用户年龄 |
| | | vo.setAge(AgeUtils.getAgeFromBirthTime(birthday)); |
| | | //获取用户性别 |
| | | int sex = Integer.parseInt(vo.getCardNo().substring(16, 17)); |
| | | if(sex%2 == 1){ |
| | | vo.setSex(PopulSexEnum.nan.getCode()); |
| | | }else{ |
| | | vo.setSex(PopulSexEnum.nv.getCode()); |
| | | } |
| | | if(oneData.get(2) != null){ |
| | | vo.setNation(oneData.get(2)); |
| | | } |
| | | if(oneData.get(3) != null){ |
| | | vo.setPoliticalOutlook(PopulPoliticalOutlookEnum.getCodeByName(oneData.get(3))); |
| | | } |
| | | if(oneData.get(4) != null){ |
| | | vo.setIsRent(PopulIsOkEnum.getCodeByName(oneData.get(4))); |
| | | } |
| | | if(oneData.get(5) != null){ |
| | | vo.setRelation(oneData.get(5)); |
| | | } |
| | | if(oneData.get(6) != null){ |
| | | vo.setRoad(oneData.get(6)); |
| | | } |
| | | if(oneData.get(7) != null){ |
| | | vo.setDoorNo(Integer.valueOf(oneData.get(7))); |
| | | } |
| | | if(oneData.get(8) != null){ |
| | | vo.setFloor(oneData.get(8)); |
| | | } |
| | | if(oneData.get(9) != null){ |
| | | vo.setUnitNo(Integer.valueOf(oneData.get(9))); |
| | | } |
| | | if(oneData.get(10) != null){ |
| | | vo.setHouseNo(Integer.valueOf(oneData.get(10))); |
| | | } |
| | | if(oneData.get(11) != null){ |
| | | vo.setPhone(oneData.get(11)); |
| | | } |
| | | if(oneData.get(12) != null){ |
| | | vo.setNativePlace(oneData.get(12)); |
| | | } |
| | | if(oneData.get(13) != null){ |
| | | vo.setCultureLevel(oneData.get(13)); |
| | | } |
| | | if(oneData.get(14) != null){ |
| | | vo.setMarriage(oneData.get(14)); |
| | | } |
| | | if(oneData.get(15) != null){ |
| | | vo.setHealthy(oneData.get(15)); |
| | | } |
| | | if(oneData.get(16) != null){ |
| | | vo.setWorkCompany(oneData.get(16)); |
| | | } |
| | | if(oneData.get(17) != null){ |
| | | vo.setRemark(oneData.get(17)); |
| | | } |
| | | for (int i = 18; i < headSize; i++) { |
| | | if (oneData.get(i) != null && oneData.get(i).equals("是")) { |
| | | vo.getUserTagStr().add(headData.get(i)); |
| | | } |
| | | } |
| | | voList.add(vo); |
| | | index++; |
| | | } |
| | | R r = communityService.listSavePopulationConfirm(voList, communityId); |
| | | if (!R.isOk(r)) { |
| | | throw new ServiceException(r.getMsg()); |
| | | } |
| | | } catch (NumberFormatException e) { |
| | | throw new ServiceException("500", "填写数据格式错误:第" + index + "行" + e.getMessage()); |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | import com.alibaba.excel.context.AnalysisContext; |
| | | import com.alibaba.excel.event.AnalysisEventListener; |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.google.common.collect.Lists; |
| | | import com.panzhihua.common.enums.PopulIsOkEnum; |
| | |
| | | import com.panzhihua.common.enums.PopulSexEnum; |
| | | import com.panzhihua.common.exceptions.ServiceException; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.ComMngPopulationImportErrorVO; |
| | | import com.panzhihua.common.model.vos.community.ComMngPopulationServeExcelVO; |
| | | import com.panzhihua.common.model.vos.community.ComMngVillageServeExcelVO; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | import com.panzhihua.common.utlis.AgeUtils; |
| | | import com.panzhihua.common.utlis.IdCardUtil; |
| | | import com.panzhihua.common.utlis.StringUtils; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | |
| | | /** |
| | | * 每隔5条存储数据库,实际使用中可以3000条,然后清理list ,方便内存回收 |
| | | */ |
| | | private static final int BATCH_COUNT = 100; |
| | | private static final int BATCH_COUNT = 5000; |
| | | List<Map<Integer, String>> list = new ArrayList<Map<Integer, String>>(); |
| | | |
| | | @Override |
| | |
| | | int index = 2; |
| | | try { |
| | | ArrayList<ComMngPopulationServeExcelVO> voList = Lists.newArrayList(); |
| | | List<ComMngPopulationImportErrorVO> populationImportErrorVOList = new ArrayList<>(); |
| | | for (Map<Integer, String> oneData : list) { |
| | | ComMngPopulationServeExcelVO vo = new ComMngPopulationServeExcelVO(); |
| | | if(oneData.get(0) == null){ |
| | | throw new ServiceException("500", "名字不可为空:第" + index + "行,第1列"); |
| | | ComMngPopulationImportErrorVO importErrorVO = new ComMngPopulationImportErrorVO(); |
| | | importErrorVO.setErrorPosition("第" + index + "行,第1列"); |
| | | importErrorVO.setErrorMsg("名字不可为空,请填写姓名"); |
| | | populationImportErrorVOList.add(importErrorVO); |
| | | index++; |
| | | continue; |
| | | } |
| | | vo.setName(oneData.get(0)); |
| | | if(oneData.get(1) == null){ |
| | | throw new ServiceException("500", "身份证号不可为空:第" + index + "行,第2列"); |
| | | if(StringUtils.isEmpty(oneData.get(1))){ |
| | | ComMngPopulationImportErrorVO importErrorVO = new ComMngPopulationImportErrorVO(); |
| | | importErrorVO.setErrorPosition("第" + index + "行,第2列"); |
| | | importErrorVO.setErrorMsg("身份证号不可为空,请填写身份证号"); |
| | | populationImportErrorVOList.add(importErrorVO); |
| | | index++; |
| | | continue; |
| | | } |
| | | // if(!IdCardUtil.identityValidator(oneData.get(1))){ |
| | | // throw new ServiceException("500", "身份证号格式错误:第" + index + "行,第2列"); |
| | | // } |
| | | //判断身份证号码位数 |
| | | if(oneData.get(1).length() != 18){ |
| | | ComMngPopulationImportErrorVO importErrorVO = new ComMngPopulationImportErrorVO(); |
| | | importErrorVO.setErrorPosition("第" + index + "行,第2列"); |
| | | importErrorVO.setErrorMsg("身份证号位数有误,请检查身份证号码是否正确"); |
| | | populationImportErrorVOList.add(importErrorVO); |
| | | index++; |
| | | continue; |
| | | } |
| | | vo.setCardNo(oneData.get(1)); |
| | | //根据身份证号码解析年龄以及性别 |
| | |
| | | } |
| | | for (int i = 18; i < headSize; i++) { |
| | | if (oneData.get(i) != null && oneData.get(i).equals("是")) { |
| | | vo.getUserTagStr().add(headData.get(i)); |
| | | vo.getUserTagStr().add(headData.get(i).substring(0,headData.get(i).indexOf("("))); |
| | | } |
| | | } |
| | | voList.add(vo); |
| | | index++; |
| | | } |
| | | //客户需要暂时注释,等客户处理完成需要恢复 |
| | | // if(populationImportErrorVOList.isEmpty()){ |
| | | // R r = communityService.listSavePopulationServeExcelVO(voList, communityId); |
| | | // if (!R.isOk(r)) { |
| | | // throw new ServiceException(r.getMsg()); |
| | | // } |
| | | // }else{ |
| | | // throw new ServiceException("500", JSON.toJSONString(populationImportErrorVOList)); |
| | | // } |
| | | R r = communityService.listSavePopulationServeExcelVO(voList, communityId); |
| | | if (!R.isOk(r)) { |
| | | throw new ServiceException(r.getMsg()); |
| | | String errMsg = r.getMsg(); |
| | | List<ComMngPopulationImportErrorVO> errorList = JSON.parseArray(errMsg,ComMngPopulationImportErrorVO.class); |
| | | if(!errorList.isEmpty()){ |
| | | populationImportErrorVOList.addAll(errorList); |
| | | } |
| | | throw new ServiceException("500", JSON.toJSONString(populationImportErrorVOList)); |
| | | }else{ |
| | | if(!populationImportErrorVOList.isEmpty()){ |
| | | throw new ServiceException("500", JSON.toJSONString(populationImportErrorVOList)); |
| | | } |
| | | } |
| | | } catch (NumberFormatException e) { |
| | | throw new ServiceException("500", "填写数据格式错误:第" + index + "行" + e.getMessage()); |
| | | List<ComMngPopulationImportErrorVO> populationImportErrorVOList = new ArrayList<>(); |
| | | ComMngPopulationImportErrorVO importErrorVO = new ComMngPopulationImportErrorVO(); |
| | | importErrorVO.setErrorPosition("第" + index + "行"); |
| | | importErrorVO.setErrorMsg("数据格式有误,请检查文档内数据"); |
| | | populationImportErrorVOList.add(importErrorVO); |
| | | index++; |
| | | throw new ServiceException("500", JSON.toJSONString(populationImportErrorVOList)); |
| | | } |
| | | } |
| | | } |
| | |
| | | import com.alibaba.excel.context.AnalysisContext; |
| | | import com.alibaba.excel.event.AnalysisEventListener; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.panzhihua.common.enums.RealAssetsCategoryType; |
| | | import com.panzhihua.common.exceptions.ServiceException; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.ComMngRealAssetsExcelVO; |
| | | import com.panzhihua.common.model.vos.community.ComMngRealCompanyExcelVO; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | import com.panzhihua.common.utlis.StringUtils; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | import java.util.ArrayList; |
| | |
| | | * 社区id |
| | | */ |
| | | @ApiModelProperty(value="社区id",hidden = true) |
| | | private Integer actId; |
| | | private Long actId; |
| | | /** |
| | | * 小区id(实有房屋id) |
| | | */ |
New file |
| | |
| | | package com.panzhihua.common.model.dtos.community; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @auther llming |
| | | * @describe |
| | | */ |
| | | @Data |
| | | @ApiModel("办事指南请求参数") |
| | | public class PageActWorkGuideDTO { |
| | | |
| | | @ApiModelProperty("办事指南标题") |
| | | private String title; |
| | | |
| | | @ApiModelProperty(value = "分页-当前页数",example = "1") |
| | | private Long pageNum; |
| | | |
| | | @ApiModelProperty(value = "分页-每页记录数",example = "10") |
| | | private Long pageSize; |
| | | } |
| | |
| | | private Integer priceOrder; |
| | | |
| | | @ApiModelProperty(value="发布人姓名") |
| | | private String userRealName; |
| | | private String userName; |
| | | @ApiModelProperty(value="联系方式") |
| | | private String mobile; |
| | | |
| | |
| | | package com.panzhihua.common.model.dtos.community; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | |
| | | @ApiModelProperty(value = "状态 0 调研中 1已停止") |
| | | private Integer state; |
| | | @ApiModelProperty(value = "发布开始时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date startTime; |
| | | @ApiModelProperty(value = "发布结束时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date endTime; |
| | | @ApiModelProperty(value = "分页-当前页数", example = "1") |
| | | private Long pageNum; |
New file |
| | |
| | | package com.panzhihua.common.model.dtos.shop; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @auther lyq |
| | | * @create 2021-04-14 15:02:14 |
| | | * @describe 分页查询店铺 |
| | | */ |
| | | @Data |
| | | @ApiModel("分页查询店铺") |
| | | public class ComShopAddressDTO { |
| | | |
| | | @ApiModelProperty(value = "用户id",hidden = true) |
| | | private Long userId; |
| | | |
| | | @ApiModelProperty("用户收货地址id") |
| | | private Long addressId; |
| | | |
| | | @ApiModelProperty("收货人名称") |
| | | private String name; |
| | | |
| | | @ApiModelProperty("收货人手机号") |
| | | private String phone; |
| | | |
| | | @ApiModelProperty("收货人省份编码") |
| | | private String provinceCode; |
| | | |
| | | @ApiModelProperty("收货人城市编码") |
| | | private String cityCode; |
| | | |
| | | @ApiModelProperty("收货人区县编码") |
| | | private String districtCode; |
| | | |
| | | @ApiModelProperty("收货人详细地址") |
| | | private String detailAddress; |
| | | |
| | | @ApiModelProperty("是否是默认地址(1.是 2.否)") |
| | | private Integer isDefault; |
| | | |
| | | @ApiModelProperty("收货人省份名称") |
| | | private String provinceName; |
| | | |
| | | @ApiModelProperty("收货人城市名称") |
| | | private String cityName; |
| | | |
| | | @ApiModelProperty("收货人区/县名称") |
| | | private String districtName; |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.dtos.shop; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @auther lyq |
| | | * @create 2021-04-14 15:02:14 |
| | | * @describe 购物车 |
| | | */ |
| | | @Data |
| | | @ApiModel("购物车") |
| | | public class ComShopCartDTO { |
| | | |
| | | /** |
| | | * 商品id |
| | | */ |
| | | @ApiModelProperty(value = "商品名称",required = true) |
| | | private Long goodsId; |
| | | |
| | | /** |
| | | * 商品规格id |
| | | */ |
| | | @ApiModelProperty(value = "商品规格id",required = true) |
| | | private Long goodsAttrId; |
| | | |
| | | /** |
| | | * 数量 |
| | | */ |
| | | @ApiModelProperty(value = "数量",required = true) |
| | | private Integer number; |
| | | |
| | | /** |
| | | * 用户id |
| | | */ |
| | | @ApiModelProperty(value = "用户id",hidden = true) |
| | | private Long userId; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.dtos.shop; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @auther lyq |
| | | * @create 2021-04-14 15:02:14 |
| | | * @describe 购物车修改 |
| | | */ |
| | | @Data |
| | | @ApiModel("购物车修改") |
| | | public class ComShopEditNubCartDTO { |
| | | |
| | | @ApiModelProperty(value = "购物车id",required = true) |
| | | private Long cartId; |
| | | |
| | | @ApiModelProperty(value = "购物车商品数量",required = true) |
| | | private Integer number; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.dtos.shop; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.fasterxml.jackson.annotation.JsonIgnore; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @ClasssName OrderShipDTO |
| | | * @Description TODO |
| | | * @Author cedoo |
| | | * @Date 2021/4/16 |
| | | * @Version 1.0 |
| | | **/ |
| | | @Data |
| | | @ApiModel("订单导出信息") |
| | | public class ComShopFundsExportDTO { |
| | | |
| | | @ApiModelProperty(value = "订单编号",example = "316356541616") |
| | | private String orderNo; |
| | | @ApiModelProperty(value = "支付时间-开始",example = "2021-03-18 19:59:06") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date payTimeStart; |
| | | @ApiModelProperty(value = "支付时间-结束",example = "2021-04-18 19:59:14") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date payTimeEnd; |
| | | @ApiModelProperty(value = "订单ID-如果指定了订单ID,只导出指定订单,其它搜索条件将被忽略", notes = "如果指定了订单ID,其它搜索条件将被忽略,只导出指定订单") |
| | | private Long[] orderIds; |
| | | @JsonIgnore |
| | | private Long userId; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.dtos.shop; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @auther lyq |
| | | * @create 2021-04-14 15:02:14 |
| | | * @describe 查询商品请求参数 |
| | | */ |
| | | @Data |
| | | @ApiModel("查询商品请求参数") |
| | | public class ComShopGoodsDTO { |
| | | |
| | | @ApiModelProperty(value = "分页-当前页数",example = "1") |
| | | private Long pageNum = 1L; |
| | | |
| | | @ApiModelProperty(value = "分页-每页记录数",example = "10") |
| | | private Long pageSize = 10L; |
| | | |
| | | @ApiModelProperty("商品名称") |
| | | private String name; |
| | | |
| | | @ApiModelProperty("店铺id") |
| | | private Long storeId; |
| | | |
| | | @ApiModelProperty("商品状态(1.出售中 2.已下架 3.回收站)") |
| | | private Integer status; |
| | | |
| | | @ApiModelProperty("配送方式(1.商家配送 2.快递物流)") |
| | | private Integer deliveryType; |
| | | |
| | | @ApiModelProperty(hidden = true) |
| | | private Long userId; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.dtos.shop; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @auther lyq |
| | | * @create 2021-04-14 15:02:14 |
| | | * @describe 创建订单请求参数 |
| | | */ |
| | | @Data |
| | | @ApiModel("创建订单请求参数") |
| | | public class ComShopOrderCreateDTO { |
| | | |
| | | @ApiModelProperty(value = "用户id",hidden = true) |
| | | private Long userId; |
| | | |
| | | @ApiModelProperty(value = "用户手机号",hidden = true) |
| | | private String phone; |
| | | |
| | | @ApiModelProperty(value = "用户openId",hidden = true) |
| | | private String openId; |
| | | |
| | | @ApiModelProperty(value = "用户收货地址id",required = true) |
| | | private Long receiverId; |
| | | |
| | | @ApiModelProperty(value = "订单备注") |
| | | private String remark; |
| | | |
| | | @ApiModelProperty(value = "提交订单商品列表",required = true) |
| | | private List<ComShopOrderCreateGoodsDTO> orderGoodsList; |
| | | |
| | | @ApiModelProperty(value = "提交类型(1.商品详情提交 2.购物车提交)",required = true) |
| | | private Integer submitType; |
| | | |
| | | @ApiModelProperty(value = "购物车记录id集合(当提交类型为2时,此字段必填)") |
| | | private List<Long> cartIds; |
| | | |
| | | /** |
| | | * 提交类型(1.商品详情提交 2.购物车提交) |
| | | */ |
| | | public interface submitType{ |
| | | int details = 1; |
| | | int cart = 2; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.dtos.shop; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @auther lyq |
| | | * @create 2021-04-14 15:02:14 |
| | | * @describe 创建订单商品信息请求参数 |
| | | */ |
| | | @Data |
| | | @ApiModel("创建订单商品信息请求参数") |
| | | public class ComShopOrderCreateGoodsDTO { |
| | | |
| | | @ApiModelProperty(value = "商品id") |
| | | private Long goodsId; |
| | | |
| | | @ApiModelProperty(value = "商品规格id") |
| | | private Long goodsAttrId; |
| | | |
| | | @ApiModelProperty(value = "购买数量") |
| | | private Integer num; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.dtos.shop; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.NonNull; |
| | | |
| | | import javax.validation.constraints.Min; |
| | | |
| | | /** |
| | | * @ClasssName OrderShipDTO |
| | | * @Description TODO |
| | | * @Author cedoo |
| | | * @Date 2021/4/16 |
| | | * @Version 1.0 |
| | | **/ |
| | | @Data |
| | | @ApiModel("订单配送信息") |
| | | public class ComShopOrderDeliverDTO { |
| | | @ApiModelProperty(value = "订单ID") |
| | | private Long orderId; |
| | | @ApiModelProperty(value = "操作账号", hidden = true) |
| | | private String operUserAccount; |
| | | @ApiModelProperty(value = "是否是管理员", hidden = true) |
| | | private Boolean isAdmin = false; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.dtos.shop; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.fasterxml.jackson.annotation.JsonIgnore; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @ClasssName OrderShipDTO |
| | | * @Description TODO |
| | | * @Author cedoo |
| | | * @Date 2021/4/16 |
| | | * @Version 1.0 |
| | | **/ |
| | | @Data |
| | | @ApiModel("订单导出信息") |
| | | public class ComShopOrderExportDTO { |
| | | |
| | | @ApiModelProperty(value = "订单编号",example = "316356541616") |
| | | private String orderNo; |
| | | @ApiModelProperty(value = "用户账号") |
| | | private String userAccount; |
| | | @ApiModelProperty(value = "收货人",example = "张三") |
| | | private String receiverAccount; |
| | | @ApiModelProperty(value = "收货人电话",example = "13123456789") |
| | | private String receiverPhone; |
| | | @ApiModelProperty(value = "商品",example = "鞋") |
| | | private String goodsName; |
| | | @ApiModelProperty(value = "订单状态(1.待付款 2.代发货 3.待收货 4.待评价 5.已完成 6.已取消)",example = "1") |
| | | private Integer status; |
| | | @ApiModelProperty(value = "下单时间-开始",example = "2021-04-01 19:58:41") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private String createAtStart; |
| | | @ApiModelProperty(value = "下单时间-结束",example = "2021-04-18 19:58:54") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date createAtEnd; |
| | | @ApiModelProperty(value = "订单ID-如果指定了订单ID,只导出指定订单,其它搜索条件将被忽略", notes = "") |
| | | private Long[] orderIds; |
| | | @ApiModelProperty(hidden = true) |
| | | private Long userId; |
| | | @ApiModelProperty(hidden = true) |
| | | private Long storeUserId; |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.dtos.shop; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @auther lyq |
| | | * @create 2021-04-14 15:02:14 |
| | | * @describe 订单预览请求参数 |
| | | */ |
| | | @Data |
| | | @ApiModel("订单预览请求参数") |
| | | public class ComShopOrderPreviewDTO { |
| | | |
| | | /** |
| | | * 提交类型(1.商品详情提交 2.购物车提交) |
| | | */ |
| | | @ApiModelProperty(value = "提交类型(1.商品详情提交 2.购物车提交)",required = true) |
| | | private Integer submitType; |
| | | |
| | | /** |
| | | * 商品id(当提交类型为1时,此字段必填) |
| | | */ |
| | | @ApiModelProperty(value = "商品id(当提交类型为1时,此字段必填)") |
| | | private Long goodsId; |
| | | |
| | | /** |
| | | * 商品规格id(当提交类型为1时,此字段必填) |
| | | */ |
| | | @ApiModelProperty(value = "商品规格id(当提交类型为1时,此字段必填)") |
| | | private Long goodsAttrId; |
| | | |
| | | /** |
| | | * 购买数量(当提交类型为1时,此字段必填) |
| | | */ |
| | | @ApiModelProperty(value = "购买数量(当提交类型为1时,此字段必填)") |
| | | private Integer buyNum; |
| | | |
| | | /** |
| | | * 购物车记录id集合(当提交类型为2时,此字段必填) |
| | | */ |
| | | @ApiModelProperty(value = "提交类型(1.商品详情提交 2.购物车提交)") |
| | | private List<Long> cartIds; |
| | | |
| | | /** |
| | | * 用户id |
| | | */ |
| | | @ApiModelProperty(value = "用户id",hidden = true) |
| | | private Long userId; |
| | | |
| | | /** |
| | | * 提交类型(1.商品详情提交 2.购物车提交) |
| | | */ |
| | | public interface submitType{ |
| | | int details = 1; |
| | | int cart = 2; |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.dtos.shop; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @auther lyq |
| | | * @create 2021-04-14 15:02:14 |
| | | * @describe 请求参数 |
| | | */ |
| | | @Data |
| | | @ApiModel("请求参数") |
| | | public class ComShopOrderQueryDTO { |
| | | |
| | | @ApiModelProperty(value = "订单id") |
| | | private Long orderId; |
| | | |
| | | @ApiModelProperty(value = "手机号",hidden = true) |
| | | private String phone; |
| | | |
| | | @ApiModelProperty(value = "操作账号", hidden = true) |
| | | private String operUserAccount; |
| | | |
| | | @ApiModelProperty(value = "是否是管理员", hidden = true) |
| | | private Boolean isAdmin = false; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.dtos.shop; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @ClasssName OrderShipDTO |
| | | * @Description TODO |
| | | * @Author cedoo |
| | | * @Date 2021/4/16 |
| | | * @Version 1.0 |
| | | **/ |
| | | @Data |
| | | @ApiModel("订单发货信息") |
| | | public class ComShopOrderShipDTO { |
| | | @ApiModelProperty(value = "ID") |
| | | private Long orderId; |
| | | @ApiModelProperty(value = "物流公司") |
| | | private String logisticsCompany; |
| | | @ApiModelProperty(value = "物流单号") |
| | | private String logisticsNo; |
| | | @ApiModelProperty(value = "操作账号", hidden = true) |
| | | private String operUserAccount; |
| | | @ApiModelProperty(value = "是否是管理员", hidden = true) |
| | | private Boolean isAdmin; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.dtos.shop; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import com.alibaba.excel.annotation.format.NumberFormat; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.text.DecimalFormat; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @description: 商城订单导出 |
| | | * @author: Null |
| | | * @date: 2021-4-18 16:13:21 |
| | | */ |
| | | @Data |
| | | public class ExcelShopFundsDTO { |
| | | |
| | | @ExcelProperty("金额") |
| | | @NumberFormat("0.00") |
| | | private BigDecimal totalAmount; |
| | | |
| | | @ExcelProperty("支付时间") |
| | | private String payTime; |
| | | |
| | | @ExcelProperty("订单编号") |
| | | private String orderNo; |
| | | |
| | | @ExcelProperty("支付方式") |
| | | private String payType; |
| | | |
| | | @ExcelProperty("收支类型") |
| | | private String type; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.dtos.shop; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import com.alibaba.excel.annotation.format.NumberFormat; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @description: 商城订单导出 |
| | | * @author: cedoo |
| | | * @date: 2021-4-18 16:13:21 |
| | | */ |
| | | @Data |
| | | public class ExcelShopOrderDTO { |
| | | |
| | | @ExcelProperty("商品总额") |
| | | @NumberFormat("0.00") |
| | | private BigDecimal goodsTotal; |
| | | |
| | | @ExcelProperty("全部商品") |
| | | private String goodsName; |
| | | |
| | | @ExcelProperty("数量总计") |
| | | private Integer goodsCount; |
| | | |
| | | @ExcelProperty("用户账号") |
| | | private String account; |
| | | |
| | | @ExcelProperty("收货人") |
| | | private String receiver; |
| | | |
| | | @ExcelProperty("收货人电话") |
| | | private String receiverPhone; |
| | | |
| | | @ExcelProperty("收货地址") |
| | | private String receiverAddress; |
| | | |
| | | @ExcelProperty("店铺名称") |
| | | private String storeName; |
| | | |
| | | @ExcelProperty("备注") |
| | | private String remark; |
| | | |
| | | @ExcelProperty("订单状态") |
| | | private String status; |
| | | |
| | | @ExcelProperty("下单时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date createAt; |
| | | |
| | | @ExcelProperty("付款时间") |
| | | private String payTime; |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.dtos.shop; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @auther lyq |
| | | * @create 2021-04-14 15:02:14 |
| | | * @describe 订单支付请求参数 |
| | | */ |
| | | @Data |
| | | @ApiModel("订单支付请求参数") |
| | | public class OrderPayDTO { |
| | | |
| | | @ApiModelProperty(value = "订单号") |
| | | private String orderNo; |
| | | |
| | | @ApiModelProperty(value = "订单号",hidden = true) |
| | | private String openId; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.dtos.shop; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @auther lyq |
| | | * @create 2021-04-14 15:02:14 |
| | | * @describe 分页查询订单列表 |
| | | */ |
| | | @Data |
| | | @ApiModel("分页查询订单列表") |
| | | public class PageComOrderListDTO { |
| | | |
| | | @ApiModelProperty(value = "分页-当前页数",example = "1") |
| | | private Long pageNum = 1L; |
| | | @ApiModelProperty(value = "分页-每页记录数",example = "10") |
| | | private Long pageSize = 10L; |
| | | |
| | | @ApiModelProperty(value = "订单状态(1.待付款 2.代发货 3.待收货 4.待评价 5.已完成 6.已取消)") |
| | | private Integer status; |
| | | |
| | | @ApiModelProperty(value = "用户id",hidden = true) |
| | | private Long userId; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.dtos.shop; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @auther lyq |
| | | * @create 2021-04-14 15:02:14 |
| | | * @describe 分页查询店铺 |
| | | */ |
| | | @Data |
| | | @ApiModel("分页查询店铺") |
| | | public class PageComShopAddressDTO { |
| | | |
| | | @ApiModelProperty(value = "分页-当前页数",example = "1") |
| | | private Long pageNum = 1L; |
| | | |
| | | @ApiModelProperty(value = "分页-每页记录数",example = "10") |
| | | private Long pageSize = 10L; |
| | | |
| | | @ApiModelProperty(value = "用户id",hidden = true) |
| | | private Long userId; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.dtos.shop; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.fasterxml.jackson.annotation.JsonIgnore; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @ClasssName OrderSearchDTO |
| | | * @Description 资金管理DTO |
| | | * @Author cedoo |
| | | * @Date 2021/4/16 |
| | | * @Version 1.0 |
| | | **/ |
| | | @Data |
| | | @ApiModel("资金管理查询参数") |
| | | public class PageComShopFundsSearchDTO { |
| | | @ApiModelProperty(value = "订单编号",example = "316356541616") |
| | | private String orderNo; |
| | | @ApiModelProperty(value = "支付时间-开始",example = "2021-03-18 19:59:06") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date payTimeStart; |
| | | @ApiModelProperty(value = "支付时间-结束",example = "2021-04-18 19:59:14") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date payTimeEnd; |
| | | @ApiModelProperty(value = "分页-当前页数",example = "1", required = true) |
| | | private Long pageNum; |
| | | @ApiModelProperty(value = "分页-每页记录数",example = "10", required = true) |
| | | private Long pageSize; |
| | | @ApiModelProperty(hidden = true) |
| | | private Long userId; |
| | | } |
| | |
| | | @ApiModel("分页查询商品") |
| | | @Data |
| | | public class PageComShopGoodsDTO { |
| | | |
| | | @ApiModelProperty(value = "商品名称") |
| | | private String name; |
| | | |
| | | @ApiModelProperty(value = "店铺名称") |
| | | private String storeName; |
| | | @ApiModelProperty(value = "店铺Id") |
| | | private Long storeId; |
| | | |
| | | @ApiModelProperty(value = "商品状态(1.出售中 2.已下架 3.回收站)", example = "1") |
| | | private Integer status; |
| | | |
| | | @ApiModelProperty(value = "分页-当前页数", example = "1") |
| | | private Long pageNum; |
| | | |
New file |
| | |
| | | package com.panzhihua.common.model.dtos.shop; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.fasterxml.jackson.annotation.JsonIgnore; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.NotNull; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @ClasssName OrderSearchDTO |
| | | * @Description 订单搜索DTO |
| | | * @Author cedoo |
| | | * @Date 2021/4/16 |
| | | * @Version 1.0 |
| | | **/ |
| | | @Data |
| | | public class PageComShopOrderSearchDTO { |
| | | @ApiModelProperty(value = "订单编号",example = "316356541616") |
| | | private String orderNo; |
| | | @ApiModelProperty(value = "用户账号") |
| | | private String userAccount; |
| | | @ApiModelProperty(value = "收货人",example = "张三") |
| | | private String receiverAccount; |
| | | @ApiModelProperty(value = "收货人电话",example = "13123456789") |
| | | private String receiverPhone; |
| | | @ApiModelProperty(value = "商品",example = "鞋") |
| | | private String goodsName; |
| | | @ApiModelProperty(value = "店铺名称",example = "小二的店") |
| | | private String storeName; |
| | | @ApiModelProperty(value = "订单状态(1.待付款 2.代发货 3.待收货 4.待评价 5.已完成 6.已取消)",example = "1") |
| | | private Integer status; |
| | | @ApiModelProperty(value = "下单时间-开始",example = "2021-4-10 10:38:25") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private String createAtStart; |
| | | @ApiModelProperty(value = "下单时间-结束",example = "2021-4-20 10:38:29") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date createAtEnd; |
| | | @ApiModelProperty(value = "分页-当前页数",example = "1", required = true) |
| | | private Long pageNum; |
| | | @ApiModelProperty(value = "分页-每页记录数",example = "10", required = true) |
| | | private Long pageSize; |
| | | @ApiModelProperty(hidden = true) |
| | | private Long userId; |
| | | @ApiModelProperty(hidden = true) |
| | | private Long storeId; |
| | | @ApiModelProperty(hidden = true) |
| | | private Long storeUserId; |
| | | } |
| | |
| | | @Data |
| | | @ApiModel("分页查询店铺") |
| | | public class PageComShopStoreDTO { |
| | | |
| | | @ApiModelProperty(value = "分页-当前页数",example = "1") |
| | | private Long pageNum = 1L; |
| | | @ApiModelProperty(value = "商家姓名") |
| | | private String contacts; |
| | | @ApiModelProperty(value = "商家账号") |
| | | private String name; |
| | | @ApiModelProperty(value = "店铺名称") |
| | | private String account; |
| | | @ApiModelProperty(value = "店铺名称") |
| | | private String name; |
| | | @ApiModelProperty(value = "配送方式(1.商家配送 2.快递物流)") |
| | | private Integer deliveryType; |
| | | @ApiModelProperty(value = "店铺状态(1.启用 2.禁用)") |
| | | private Integer status; |
| | | @ApiModelProperty(value = "分页-当前页数", example = "1") |
| | | private Long pageNum; |
| | | |
| | | @ApiModelProperty(value = "分页-每页记录数", example = "10") |
| | | private Long pageSize; |
| | | @ApiModelProperty(value = "分页-每页记录数",example = "10") |
| | | private Long pageSize = 10L; |
| | | |
| | | @ApiModelProperty("店铺id") |
| | | private Long storeId; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.dtos.shop; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel("微信支付回调修改订单参数") |
| | | public class WxPayNotifyOrderDTO { |
| | | |
| | | @ApiModelProperty(value = "订单号") |
| | | private String orderTradeNo; |
| | | |
| | | @ApiModelProperty(value = "微信交易订单号") |
| | | private String wxTradeNo; |
| | | |
| | | @ApiModelProperty(value = "订单金额") |
| | | private String totalFee; |
| | | |
| | | @ApiModelProperty(value = "支付完成时间") |
| | | private String payTime; |
| | | |
| | | @ApiModelProperty(value = "现金支付金额") |
| | | private String cashFee; |
| | | } |
| | |
| | | private String areaName; |
| | | |
| | | @ApiModelProperty(value = "分页-当前页数",example = "1") |
| | | private Long pageNum; |
| | | private Long pageNum = 1L; |
| | | |
| | | @ApiModelProperty(value = "分页-每页记录数",example = "10") |
| | | private Long pageSize; |
| | | private Long pageSize = 10L; |
| | | |
| | | @ApiModelProperty("标签") |
| | | private String tags; |
New file |
| | |
| | | package com.panzhihua.common.model.dtos.user; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "修改用户首页活动提示请求参数") |
| | | public class SysUserEditTipsDTO { |
| | | |
| | | /** |
| | | * 小程序首页是否显示公告(1.是 2.否) |
| | | */ |
| | | @ApiModelProperty("小程序首页是否显示公告(1.是 2.否)") |
| | | private Integer isTips; |
| | | |
| | | /** |
| | | * 用户id |
| | | */ |
| | | @ApiModelProperty(value = "用户id",hidden = true) |
| | | private Long userId; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.helper; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.fasterxml.jackson.core.JsonGenerator; |
| | | import com.fasterxml.jackson.databind.BeanProperty; |
| | | import com.fasterxml.jackson.databind.JsonMappingException; |
| | | import com.fasterxml.jackson.databind.JsonSerializer; |
| | | import com.fasterxml.jackson.databind.SerializerProvider; |
| | | import com.fasterxml.jackson.databind.ser.ContextualSerializer; |
| | | |
| | | import java.io.IOException; |
| | | import java.math.BigDecimal; |
| | | import java.math.RoundingMode; |
| | | import java.text.DecimalFormat; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * BigDecimal序列化(默认保留二位小数和四舍五入) |
| | | * @author cedoo |
| | | * @date 2021-4-19 01:24:28 |
| | | */ |
| | | public class SerializerBigDecimal extends JsonSerializer<BigDecimal> implements ContextualSerializer { |
| | | |
| | | protected DecimalFormat decimalFormat; |
| | | |
| | | public SerializerBigDecimal() { |
| | | } |
| | | |
| | | public SerializerBigDecimal(DecimalFormat decimalFormat) { |
| | | this.decimalFormat = decimalFormat; |
| | | } |
| | | |
| | | @Override |
| | | public void serialize(BigDecimal value, JsonGenerator gen, SerializerProvider serializers) throws IOException { |
| | | |
| | | if(Objects.isNull(value)) { |
| | | gen.writeNull(); |
| | | } else { |
| | | if(null != decimalFormat) { |
| | | gen.writeNumber(decimalFormat.format(value)); |
| | | }else { |
| | | gen.writeNumber(value.setScale(2, BigDecimal.ROUND_HALF_UP)); |
| | | } |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public JsonSerializer<?> createContextual(SerializerProvider prov, BeanProperty property) |
| | | throws JsonMappingException { |
| | | |
| | | JsonFormat.Value format = findFormatOverrides(prov, property, handledType()); |
| | | if (format == null) { |
| | | return this; |
| | | } |
| | | |
| | | if (format.hasPattern()) { |
| | | DecimalFormat decimalFormat = new DecimalFormat(format.getPattern()); |
| | | decimalFormat.setRoundingMode(RoundingMode.HALF_UP); |
| | | return new SerializerBigDecimal(decimalFormat); |
| | | } |
| | | |
| | | return this; |
| | | } |
| | | |
| | | protected JsonFormat.Value findFormatOverrides(SerializerProvider provider, |
| | | BeanProperty prop, Class<?> typeForDefaults) |
| | | { |
| | | if (prop != null) { |
| | | return prop.findPropertyFormat(provider.getConfig(), typeForDefaults); |
| | | } |
| | | return provider.getDefaultPropertyFormat(typeForDefaults); |
| | | } |
| | | } |
| | |
| | | @ApiModelProperty("政治面貌:1 - 党员;2 - 团员;3 - 群众") |
| | | private Integer politicalOutlook; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @ApiModelProperty("小程序首页是否显示公告(1.是 2.否)") |
| | | private Integer isTips; |
| | | |
| | | } |
| | |
| | | private String detail; |
| | | |
| | | @ApiModelProperty("图片路径列表,逗号分隔") |
| | | @NotBlank(groups = {AddGroup.class},message = "图片路径列表不能为空") |
| | | //@NotBlank(groups = {AddGroup.class},message = "图片路径列表不能为空") |
| | | private String photoPathList; |
| | | |
| | | @ApiModelProperty("当前页数") |
New file |
| | |
| | | package com.panzhihua.common.model.vos.community; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @auther llming |
| | | * @describe |
| | | */ |
| | | @Data |
| | | @ApiModel("办事指南材料") |
| | | public class ComActWorkGuideMaterialVO { |
| | | @ApiModelProperty("办事指南材料id") |
| | | private Long id; |
| | | @ApiModelProperty("申报材料名称") |
| | | private String materialName; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.community; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.google.common.collect.Lists; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @auther llming |
| | | * @describe 办事指南 |
| | | */ |
| | | @Data |
| | | @ApiModel("办事指南") |
| | | public class ComActWorkGuideVO { |
| | | @ApiModelProperty("办事指南id") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty("办事指南标题") |
| | | private String title; |
| | | |
| | | @ApiModelProperty("办事指南内容") |
| | | private String content; |
| | | |
| | | @ApiModelProperty("办理时间") |
| | | private String timeAt; |
| | | |
| | | @ApiModelProperty("办理地点") |
| | | private String address; |
| | | |
| | | @ApiModelProperty("咨询电话") |
| | | private String phone; |
| | | |
| | | @ApiModelProperty("经度") |
| | | private String lon; |
| | | |
| | | @ApiModelProperty("纬度") |
| | | private String lat; |
| | | |
| | | private List<ComActWorkGuideMaterialVO> materials = Lists.newArrayList(); |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.community; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | @Data |
| | | public class ComMngPopulationImportErrorVO implements Serializable { |
| | | |
| | | @ExcelProperty(value = "错误位置", index = 0) |
| | | private String errorPosition; |
| | | |
| | | @ExcelProperty(value = "错误原因", index = 0) |
| | | private String errorMsg; |
| | | |
| | | } |
| | |
| | | import com.panzhihua.common.model.helper.sensitive.SensitiveStrategy; |
| | | import com.panzhihua.common.model.vos.user.ComHouseMemberVo; |
| | | import com.panzhihua.common.model.vos.user.ComMngFamilyInfoVO; |
| | | import com.panzhihua.common.model.vos.user.UserElectronicFileVO; |
| | | import com.panzhihua.common.validated.AddGroup; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | |
| | | @ApiModelProperty("家庭成员(姓名)") |
| | | @NotBlank(groups = {AddGroup.class},message = "家庭成员(姓名)不可为空") |
| | | private String name; |
| | | /** |
| | | * 性别(1.男 2.女 3.未知) |
| | | */ |
| | | |
| | | @ApiModelProperty("性别(1.男 2.女 3.未知)") |
| | | @NotBlank(groups = {AddGroup.class},message = "性别不可为空") |
| | | private Integer sex; |
| | | /** |
| | | * 年龄 |
| | | */ |
| | | |
| | | @ApiModelProperty("年龄") |
| | | @NotBlank(groups = {AddGroup.class},message = "年龄不可为空") |
| | | private Integer age; |
| | | /** |
| | | * 身份证号码 |
| | | */ |
| | | |
| | | @ApiModelProperty("身份证号码") |
| | | @NotBlank(groups = {AddGroup.class},message = "身份证号码不可为空") |
| | | @EncryptDecryptField |
| | | @Sensitive(strategy = SensitiveStrategy.ID_CARD) |
| | | private String cardNo; |
| | | /** |
| | | * 街路巷 |
| | | */ |
| | | |
| | | @ApiModelProperty("街路巷") |
| | | @NotBlank(groups = {AddGroup.class},message = "街路巷不可为空") |
| | | private String road; |
| | | /** |
| | | * 门牌号 |
| | | */ |
| | | |
| | | @ApiModelProperty("门牌号") |
| | | @NotBlank(groups = {AddGroup.class},message = "门牌号不可为空") |
| | | private Integer doorNo; |
| | | /** |
| | | * 楼排号 |
| | | */ |
| | | |
| | | @ApiModelProperty("楼排号") |
| | | @NotBlank(groups = {AddGroup.class},message = "楼排号不可为空") |
| | | private String floor; |
| | | /** |
| | | * 单元号 |
| | | */ |
| | | |
| | | @ApiModelProperty("单元号") |
| | | @NotBlank(groups = {AddGroup.class},message = "单元号不可为空") |
| | | private Integer unitNo; |
| | | /** |
| | | * 户室(房间号) |
| | | */ |
| | | |
| | | @ApiModelProperty("户室(房间号)") |
| | | @NotBlank(groups = {AddGroup.class},message = "户室(房间号)不可为空") |
| | | private Integer houseNo; |
| | | /** |
| | | * 政治面貌(1.中共党员2.中共预备党员3.共青团员4.民革党员5.民盟盟员6.民建会员7.8.农工党党员9.致公党党员10.九三学社社员11.台盟盟员12.无党派人士13.群众) |
| | | */ |
| | | |
| | | @ApiModelProperty("政治面貌(1.中共党员2.中共预备党员3.共青团员4.民革党员5.民盟盟员6.民建会员7.8.农工党党员9.致公党党员10.九三学社社员11.台盟盟员12.无党派人士13.群众)") |
| | | @NotBlank(groups = {AddGroup.class},message = "政治面貌不可为空") |
| | | private Integer politicalOutlook; |
| | | /** |
| | | * 工作单位 |
| | | */ |
| | | |
| | | @ApiModelProperty("工作单位") |
| | | private String workCompany; |
| | | /** |
| | | * 特殊情况 |
| | | */ |
| | | |
| | | @ApiModelProperty("特殊情况") |
| | | private String specialSituation; |
| | | /** |
| | | * 联系方式 |
| | | */ |
| | | |
| | | @ApiModelProperty("联系方式") |
| | | @NotBlank(groups = {AddGroup.class},message = "联系方式不可为空") |
| | | @EncryptDecryptField |
| | | @Sensitive(strategy = SensitiveStrategy.PHONE) |
| | | private String phone; |
| | | /** |
| | | * 备注 |
| | | */ |
| | | |
| | | @ApiModelProperty("备注") |
| | | private String remark; |
| | | /** |
| | | * 标签集合(多个标签以,隔开) |
| | | */ |
| | | @ApiModelProperty("标签集合(多个标签以,隔开)") |
| | | |
| | | @ApiModelProperty("标签集合(多个标签以,隔开,如物业工作人员,物业") |
| | | private String label; |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | |
| | | @ApiModelProperty("创建时间") |
| | | private Date createAt; |
| | | /** |
| | | * 修改时间 |
| | | */ |
| | | |
| | | @ApiModelProperty("修改时间") |
| | | private Date updateAt; |
| | | |
| | | /** |
| | | * 籍贯 |
| | | */ |
| | | |
| | | @ApiModelProperty("籍贯") |
| | | private String nativePlace; |
| | | /** |
| | | * 民族 |
| | | */ |
| | | |
| | | @ApiModelProperty("民族") |
| | | private String nation; |
| | | /** |
| | | * 小区名字 |
| | | */ |
| | | |
| | | @ApiModelProperty("小区名字") |
| | | private String alley; |
| | | /** |
| | | * 房屋成员 |
| | | */ |
| | | @ApiModelProperty("房屋成员") |
| | | |
| | | @ApiModelProperty("户主关系") |
| | | private List<ComHouseMemberVo> comMngFamilyInfoVOS; |
| | | |
| | | /** |
| | | * 是否租住(0.否 1.是) |
| | | */ |
| | | @ApiModelProperty("是否租住") |
| | | @ApiModelProperty("家庭成员信息") |
| | | private List<ComMngFamilyInfoVO> familyInfoVOList; |
| | | |
| | | @ApiModelProperty("用户电子档信息") |
| | | private UserElectronicFileVO userElectronicFileVO; |
| | | |
| | | @ApiModelProperty("是否租住 是否租住(0.否 1.是)") |
| | | @NotBlank(groups = {AddGroup.class},message = "是否租住不可为空") |
| | | private Integer isRent; |
| | | |
| | | /** |
| | | * 文化程度 |
| | | */ |
| | | |
| | | @ApiModelProperty("文化程度") |
| | | private String cultureLevel; |
| | | |
| | | /** |
| | | * 婚姻状况 |
| | | */ |
| | | |
| | | @ApiModelProperty("婚姻状况") |
| | | private String marriage; |
| | | |
| | | /** |
| | | * 健康状况 |
| | | */ |
| | | |
| | | @ApiModelProperty("健康状况") |
| | | private String healthy; |
| | | |
| | | /** |
| | | * 性别(1.男 2.女 3.未知) |
| | | */ |
| | | public interface sex{ |
| | | int nan = 1; |
| | | int nv = 2; |
| | |
| | | private Integer integral; |
| | | |
| | | @ApiModelProperty(value = "用户userid",hidden = true) |
| | | @Deprecated |
| | | private Long userId; |
| | | |
| | | @ApiModelProperty(value = "申请提交人ID",hidden = true) |
| | | private Long submitUserId; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.community; |
| | | |
| | | import com.panzhihua.common.model.helper.encrypt.EncryptDecryptClass; |
| | | import com.panzhihua.common.model.helper.encrypt.EncryptDecryptField; |
| | | import com.panzhihua.common.model.helper.sensitive.Sensitive; |
| | | import com.panzhihua.common.model.helper.sensitive.SensitiveStrategy; |
| | | import com.panzhihua.common.model.vos.user.ComHouseMemberVo; |
| | | import com.panzhihua.common.validated.AddGroup; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 实有人口Vo |
| | | */ |
| | | @Data |
| | | @ApiModel("实有人口表") |
| | | @EncryptDecryptClass |
| | | public class EditComMngPopulationVO implements Serializable { |
| | | |
| | | /** |
| | | * 自增 id |
| | | */ |
| | | @ApiModelProperty("实有人口id") |
| | | private Long id; |
| | | /** |
| | | * 小区id(实有房屋id) |
| | | */ |
| | | @ApiModelProperty("小区id(实有房屋id)") |
| | | private Integer villageId; |
| | | /** |
| | | * 家庭成员(姓名) |
| | | */ |
| | | @ApiModelProperty("家庭成员(姓名)") |
| | | @NotBlank(groups = {AddGroup.class},message = "家庭成员(姓名)不可为空") |
| | | private String name; |
| | | |
| | | @ApiModelProperty("性别(1.男 2.女 3.未知)") |
| | | @NotBlank(groups = {AddGroup.class},message = "性别不可为空") |
| | | private Integer sex; |
| | | |
| | | @ApiModelProperty("年龄") |
| | | @NotBlank(groups = {AddGroup.class},message = "年龄不可为空") |
| | | private Integer age; |
| | | |
| | | @NotBlank(groups = {AddGroup.class},message = "身份证号码不可为空") |
| | | @ApiModelProperty("身份证号码") |
| | | @EncryptDecryptField |
| | | @Sensitive(strategy = SensitiveStrategy.ID_CARD) |
| | | private String cardNo; |
| | | |
| | | @ApiModelProperty("街路巷") |
| | | @NotBlank(groups = {AddGroup.class},message = "街路巷不可为空") |
| | | private String road; |
| | | |
| | | @ApiModelProperty("门牌号") |
| | | @NotBlank(groups = {AddGroup.class},message = "门牌号不可为空") |
| | | private Integer doorNo; |
| | | |
| | | @ApiModelProperty("楼排号") |
| | | @NotBlank(groups = {AddGroup.class},message = "楼排号不可为空") |
| | | private String floor; |
| | | |
| | | @ApiModelProperty("单元号") |
| | | @NotBlank(groups = {AddGroup.class},message = "单元号不可为空") |
| | | private Integer unitNo; |
| | | |
| | | @ApiModelProperty("户室(房间号)") |
| | | @NotBlank(groups = {AddGroup.class},message = "户室(房间号)不可为空") |
| | | private Integer houseNo; |
| | | |
| | | @ApiModelProperty("政治面貌(1.中共党员2.中共预备党员3.共青团员4.民革党员5.民盟盟员6.民建会员7.8.农工党党员9.致公党党员10.九三学社社员11.台盟盟员12.无党派人士13.群众)") |
| | | @NotBlank(groups = {AddGroup.class},message = "政治面貌不可为空") |
| | | private Integer politicalOutlook; |
| | | |
| | | @ApiModelProperty("工作单位") |
| | | private String workCompany; |
| | | |
| | | @ApiModelProperty("特殊情况") |
| | | private String specialSituation; |
| | | |
| | | @ApiModelProperty("联系方式") |
| | | @NotBlank(groups = {AddGroup.class},message = "联系方式不可为空") |
| | | @EncryptDecryptField |
| | | @Sensitive(strategy = SensitiveStrategy.ID_CARD) |
| | | private String phone; |
| | | |
| | | @ApiModelProperty("备注") |
| | | private String remark; |
| | | |
| | | @ApiModelProperty("标签集合(多个标签以,隔开,如物业工作人员,物业") |
| | | private String label; |
| | | |
| | | @ApiModelProperty("籍贯") |
| | | private String nativePlace; |
| | | |
| | | @ApiModelProperty("民族") |
| | | private String nation; |
| | | |
| | | @ApiModelProperty("小区名字") |
| | | private String alley; |
| | | |
| | | |
| | | @ApiModelProperty("是否租住 是否租住(0.否 1.是)") |
| | | @NotBlank(groups = {AddGroup.class},message = "是否租住不可为空") |
| | | private Integer isRent; |
| | | |
| | | |
| | | @ApiModelProperty("文化程度") |
| | | private String cultureLevel; |
| | | |
| | | |
| | | @ApiModelProperty("婚姻状况") |
| | | private String marriage; |
| | | |
| | | |
| | | @ApiModelProperty("健康状况") |
| | | private String healthy; |
| | | |
| | | public interface sex{ |
| | | int nan = 1; |
| | | int nv = 2; |
| | | int no = 3; |
| | | } |
| | | |
| | | /** |
| | | * 是否租住 |
| | | */ |
| | | public interface isOk{ |
| | | int yes = 1; |
| | | int no = 0; |
| | | } |
| | | |
| | | /** |
| | | * 政治面貌 |
| | | */ |
| | | public interface politicalOutlook{ |
| | | int dang = 1; |
| | | int tuan = 3; |
| | | int wu = 12; |
| | | int qun = 13; |
| | | int no = 13; |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.shop; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.Digits; |
| | | import javax.validation.constraints.Min; |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * @auther llming |
| | | * @describe |
| | | */ |
| | | @Data |
| | | @ApiModel("商品规格") |
| | | public class AddShopGoodsAttrVO { |
| | | |
| | | @ApiModelProperty("商品规格Id:编辑必传") |
| | | private Long goodsAttrId; |
| | | |
| | | @ApiModelProperty("商品规格") |
| | | private String goodsAttr; |
| | | |
| | | @ApiModelProperty("规格价格") |
| | | @Min(value = 0,message = "价格最小值为0") |
| | | @Digits(integer = 8, fraction = 2) |
| | | private BigDecimal attrPrice; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.shop; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.Digits; |
| | | import javax.validation.constraints.Max; |
| | | import javax.validation.constraints.Min; |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @auther llming |
| | | * @describe 商品 |
| | | */ |
| | | @Data |
| | | @ApiModel("添加商品") |
| | | public class AddShopGoodsVO { |
| | | |
| | | @ApiModelProperty("店铺id") |
| | | private Long storeId; |
| | | |
| | | |
| | | @ApiModelProperty("商品名称") |
| | | private String name; |
| | | |
| | | @ApiModelProperty("商品现价") |
| | | @Min(value = 0,message = "价格最小值为0") |
| | | @Digits(integer = 8, fraction = 2) |
| | | private BigDecimal price; |
| | | |
| | | |
| | | @ApiModelProperty("商品单位") |
| | | private String unit; |
| | | |
| | | |
| | | @ApiModelProperty("商品状态(1.出售中 2.已下架 3.回收站)") |
| | | private Integer status; |
| | | |
| | | @ApiModelProperty("商品主图") |
| | | private String goodsPic; |
| | | |
| | | @ApiModelProperty("商品图片") |
| | | private String images; |
| | | |
| | | @ApiModelProperty("商品详情") |
| | | private String details; |
| | | |
| | | @ApiModelProperty("商品规格") |
| | | private List<AddShopGoodsAttrVO> goodsAttrVOList; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.shop; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @auther llming |
| | | * @describe 商家订单资金详情 |
| | | */ |
| | | @Data |
| | | public class CapitalDetailVO { |
| | | @ApiModelProperty(value = "商家账号") |
| | | private String storeAccount; |
| | | @ApiModelProperty(value = "商家姓名") |
| | | private String contacts; |
| | | @ApiModelProperty(value = "店铺名称") |
| | | private String storeName; |
| | | @ApiModelProperty(value = "金额(元)") |
| | | private BigDecimal totalAmount; |
| | | @ApiModelProperty("支付方式(1.微信支付)") |
| | | private Integer payType; |
| | | @ApiModelProperty("类型") |
| | | private String type; |
| | | @ApiModelProperty("支付时间") |
| | | private Date payTime; |
| | | @ApiModelProperty("下单时间") |
| | | private Date createAt; |
| | | @ApiModelProperty("订单号") |
| | | private String orderNo; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.shop; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @auther llming |
| | | * @describe 商家订单资金列表 |
| | | */ |
| | | @Data |
| | | public class CapitalPageVO { |
| | | @ApiModelProperty(value = "商家账号") |
| | | private String storeAccount; |
| | | @ApiModelProperty(value = "商家姓名") |
| | | private String contacts; |
| | | @ApiModelProperty(value = "店铺名称") |
| | | private String storeName; |
| | | @ApiModelProperty(value = "金额(元)") |
| | | private BigDecimal payAmount; |
| | | @ApiModelProperty(value = "订单Id") |
| | | private Long orderId; |
| | | @ApiModelProperty("支付方式(1.微信支付)") |
| | | private Integer payType; |
| | | @ApiModelProperty("类型") |
| | | private String type="订单收入"; |
| | | @ApiModelProperty("支付时间") |
| | | private Date payTime; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.shop; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @auther lyq |
| | | * @create 2021-04-14 15:02:14 |
| | | * @describe 购物车列表信息 |
| | | */ |
| | | @Data |
| | | @ApiModel("购物车列表信息") |
| | | public class ComShopCartListVO { |
| | | |
| | | /** |
| | | * 有效宝贝购物车信息 |
| | | */ |
| | | @ApiModelProperty("有效宝贝购物车信息") |
| | | private List<ComShopCartStoreVO> cartList; |
| | | |
| | | /** |
| | | * 失效宝贝购物车信息 |
| | | */ |
| | | @ApiModelProperty("失效宝贝购物车信息") |
| | | private List<ComShopCartVO> invalidCartList; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.shop; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @auther lyq |
| | | * @create 2021-04-14 15:02:14 |
| | | * @describe 有效购物车信息 |
| | | */ |
| | | @Data |
| | | @ApiModel("有效购物车信息") |
| | | public class ComShopCartStoreVO { |
| | | |
| | | /** |
| | | * 店铺id |
| | | */ |
| | | @ApiModelProperty("店铺id") |
| | | private Long storeId; |
| | | |
| | | /** |
| | | * 店铺名称 |
| | | */ |
| | | @ApiModelProperty("店铺名称") |
| | | private String storeName; |
| | | |
| | | /** |
| | | * 店铺logo |
| | | */ |
| | | @ApiModelProperty("店铺logo") |
| | | private String storeLogo; |
| | | |
| | | /** |
| | | * 店铺下购物车信息 |
| | | */ |
| | | @ApiModelProperty("店铺下购物车信息") |
| | | private List<ComShopCartVO> cartList; |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.shop; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * @auther lyq |
| | | * @create 2021-04-14 15:02:14 |
| | | * @describe 购物车信息 |
| | | */ |
| | | @Data |
| | | @ApiModel("购物车信息") |
| | | public class ComShopCartVO { |
| | | |
| | | /** |
| | | * 购物车id |
| | | */ |
| | | @ApiModelProperty("购物车id") |
| | | private Long id; |
| | | |
| | | /** |
| | | * 商品id |
| | | */ |
| | | @ApiModelProperty("商品id") |
| | | private Long goodsId; |
| | | |
| | | /** |
| | | * 商品名字 |
| | | */ |
| | | @ApiModelProperty("商品名字") |
| | | private String goodsName; |
| | | |
| | | /** |
| | | * 店铺id |
| | | */ |
| | | @ApiModelProperty("店铺id") |
| | | private Long storeId; |
| | | |
| | | /** |
| | | * 商品规格id |
| | | */ |
| | | @ApiModelProperty("商品规格id") |
| | | private Long goodsAttrId; |
| | | |
| | | /** |
| | | * 商品规格信息 |
| | | */ |
| | | @ApiModelProperty("商品规格信息") |
| | | private String goodsAttr; |
| | | |
| | | /** |
| | | * 商品规格图 |
| | | */ |
| | | @ApiModelProperty("商品规格图") |
| | | private String goodsAttrPic; |
| | | |
| | | /** |
| | | * 商品数量 |
| | | */ |
| | | @ApiModelProperty("商品数量") |
| | | private Integer amount; |
| | | |
| | | /** |
| | | * 商品价格 |
| | | */ |
| | | @ApiModelProperty("商品价格") |
| | | private BigDecimal price; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.shop; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.fasterxml.jackson.annotation.JsonIgnore; |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import com.panzhihua.common.model.helper.SerializerBigDecimal; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | @Data |
| | | @ApiModel("商户资金订单信息") |
| | | public class ComShopFundsOrderVO { |
| | | |
| | | @ApiModelProperty("金额") |
| | | //@JsonFormat(pattern = "0.00", shape = JsonFormat.Shape.STRING) |
| | | //@JsonSerialize(using = SerializerBigDecimal.class) |
| | | private BigDecimal totalAmount; |
| | | |
| | | @ApiModelProperty("支付时间") |
| | | private String payTime; |
| | | |
| | | @ApiModelProperty("订单编号") |
| | | private String orderNo; |
| | | |
| | | @ApiModelProperty("支付方式") |
| | | private String payType; |
| | | |
| | | @ApiModelProperty("收支类型") |
| | | private String type; |
| | | |
| | | @ApiModelProperty("订单ID") |
| | | private long id; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.shop; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.fasterxml.jackson.annotation.JsonIgnore; |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import com.panzhihua.common.model.helper.SerializerBigDecimal; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | @Data |
| | | @ApiModel("商户资金统计信息") |
| | | public class ComShopFundsVO { |
| | | |
| | | @ApiModelProperty(value = "当日收入") |
| | | private BigDecimal todayTotal; |
| | | |
| | | @ApiModelProperty(value = "本周收入") |
| | | private BigDecimal weekTotal; |
| | | |
| | | @ApiModelProperty(value = "本月收入") |
| | | private BigDecimal monthTotal; |
| | | |
| | | @JsonIgnore |
| | | private Long userId; |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.shop; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * @auther lyq |
| | | * @create 2021-04-14 15:02:14 |
| | | * @describe 商品规格信息 |
| | | */ |
| | | @Data |
| | | @ApiModel("商品规格信息") |
| | | public class ComShopGoodsAttrVO { |
| | | |
| | | /** |
| | | * 商品规格id |
| | | */ |
| | | @ApiModelProperty("商品规格id") |
| | | private Long id; |
| | | |
| | | /** |
| | | * 商品id |
| | | */ |
| | | @ApiModelProperty("商品id") |
| | | private Long goodsId; |
| | | |
| | | /** |
| | | * 店铺id |
| | | */ |
| | | @ApiModelProperty("店铺id") |
| | | private Long storeId; |
| | | |
| | | /** |
| | | * 商品名称 |
| | | */ |
| | | @ApiModelProperty("商品名称") |
| | | private String goodsName; |
| | | |
| | | /** |
| | | * 商品规格 |
| | | */ |
| | | @ApiModelProperty("商品规格") |
| | | private String goodsAttr; |
| | | |
| | | /** |
| | | * 商品规格库存 |
| | | */ |
| | | @ApiModelProperty("商品规格库存") |
| | | private Integer stock; |
| | | |
| | | /** |
| | | * 商品规格销量 |
| | | */ |
| | | @ApiModelProperty("商品规格销量") |
| | | private Integer sale; |
| | | |
| | | /** |
| | | * 商品规格图 |
| | | */ |
| | | @ApiModelProperty("商品规格图") |
| | | private String attrPic; |
| | | |
| | | /** |
| | | * 是否是默认规格(1.是 2.否) |
| | | */ |
| | | @ApiModelProperty("是否是默认规格(1.是 2.否)") |
| | | private Integer isDefault; |
| | | |
| | | /** |
| | | * 规格价格 |
| | | */ |
| | | @ApiModelProperty("规格价格") |
| | | private BigDecimal price; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.shop; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @auther lyq |
| | | * @create 2021-04-14 15:02:14 |
| | | * @describe 商品信息 |
| | | */ |
| | | @Data |
| | | @ApiModel("商品信息") |
| | | public class ComShopGoodsVO { |
| | | |
| | | /** |
| | | * 商品id |
| | | */ |
| | | @ApiModelProperty("商品id") |
| | | private Long id; |
| | | |
| | | /** |
| | | * 商品名称 |
| | | */ |
| | | @ApiModelProperty("商品名称") |
| | | private String name; |
| | | |
| | | /** |
| | | * 店铺id |
| | | */ |
| | | @ApiModelProperty("店铺id") |
| | | private Long storeId; |
| | | |
| | | /** |
| | | * 商品主图 |
| | | */ |
| | | @ApiModelProperty("商品主图") |
| | | private String goodsPic; |
| | | |
| | | /** |
| | | * 商品展示图 |
| | | */ |
| | | @ApiModelProperty("商品展示图") |
| | | private String images; |
| | | |
| | | /** |
| | | * 商品状态(1.出售中 2.已下架 3.回收站) |
| | | */ |
| | | @ApiModelProperty("商品状态(1.出售中 2.已下架 3.回收站)") |
| | | private Integer status; |
| | | |
| | | /** |
| | | * 商品销量 |
| | | */ |
| | | @ApiModelProperty("商品销量") |
| | | private Integer sale; |
| | | |
| | | /** |
| | | * 商品原价 |
| | | */ |
| | | @ApiModelProperty("商品原价") |
| | | private BigDecimal originalPrice; |
| | | |
| | | /** |
| | | * 商品现价 |
| | | */ |
| | | @ApiModelProperty("商品现价") |
| | | private BigDecimal price; |
| | | |
| | | /** |
| | | * 商品单位 |
| | | */ |
| | | @ApiModelProperty("商品单位") |
| | | private String unit; |
| | | |
| | | /** |
| | | * 商品排序 |
| | | */ |
| | | @ApiModelProperty("商品排序") |
| | | private Integer order; |
| | | |
| | | /** |
| | | * 商品总库存 |
| | | */ |
| | | @ApiModelProperty("商品总库存") |
| | | private Integer stock; |
| | | |
| | | /** |
| | | * 商品详情 |
| | | */ |
| | | @ApiModelProperty("商品详情") |
| | | private String details; |
| | | |
| | | /** |
| | | * 配送方式(1.商家配送 2.快递物流) |
| | | */ |
| | | @ApiModelProperty("配送方式(1.商家配送 2.快递物流)") |
| | | private Integer deliveryType; |
| | | |
| | | /** |
| | | * 商品规格列表 |
| | | */ |
| | | @ApiModelProperty("商品规格列表") |
| | | private List<ComShopGoodsAttrVO> goodsAttrList; |
| | | |
| | | /** |
| | | * 店铺信息 |
| | | */ |
| | | @ApiModelProperty("商品店铺信息") |
| | | private PageShopStoreVO shopStoreVO; |
| | | |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @ApiModelProperty("创建时间") |
| | | private Date createAt; |
| | | } |
| | |
| | | package com.panzhihua.common.model.vos.shop; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * @auther llming |
| | | * @describe |
| | | * @auther lyq |
| | | * @create 2021-04-14 15:02:14 |
| | | * @describe 订单预览商品参数 |
| | | */ |
| | | @Data |
| | | @ApiModel("商品") |
| | | @ApiModel("订单预览商品参数") |
| | | public class ComShopOrderGoodsVO { |
| | | |
| | | /** |
| | | * 商品名称 |
| | | */ |
| | | @ApiModelProperty(value = "商品名称") |
| | | private String goodsName; |
| | | |
| | | /** |
| | | * 商品图片 |
| | | */ |
| | | @ApiModelProperty(value = "商品图片") |
| | | private String goodsPic; |
| | | |
| | | /** |
| | | * 商品价格 |
| | | */ |
| | | @ApiModelProperty(value = "商品价格") |
| | | private BigDecimal price; |
| | | |
| | | /** |
| | | * 商品数量 |
| | | */ |
| | | @ApiModelProperty(value = "商品数量") |
| | | private Integer num; |
| | | |
| | | /** |
| | | * 商品id |
| | | */ |
| | | @ApiModelProperty(value = "商品id") |
| | | private Long goodsId; |
| | | |
| | | /** |
| | | * 商品规格id |
| | | */ |
| | | @ApiModelProperty(value = "商品规格id") |
| | | private Long goodsAttrId; |
| | | |
| | | /** |
| | | * 商品规格 |
| | | */ |
| | | @ApiModelProperty(value = "商品规格") |
| | | private String goodsAttr; |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.shop; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | @ApiModel("订单操作日志") |
| | | public class ComShopOrderOperateVO { |
| | | |
| | | @ApiModelProperty(value = "订单号") |
| | | private String orderNo; |
| | | |
| | | @ApiModelProperty(value = "操作人") |
| | | private String operationBy; |
| | | |
| | | @ApiModelProperty(value = "操作时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date operationTime; |
| | | |
| | | @ApiModelProperty(value = "操作类型(1.创建订单 2.取消订单 3.订单支付 4.订单发货 5.订单完成)") |
| | | private Integer operationType; |
| | | |
| | | @ApiModelProperty(value = "操作内容") |
| | | private String operationContent; |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.shop; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @ApiModel("订单信息") |
| | | public class ComShopOrderPageVO { |
| | | |
| | | @ApiModelProperty(value = "订单id") |
| | | private Long orderId; |
| | | |
| | | @ApiModelProperty(value = "订单号") |
| | | private String orderNo; |
| | | |
| | | @ApiModelProperty(value = "订单金额") |
| | | private BigDecimal orderTotal; |
| | | |
| | | @ApiModelProperty(value = "店铺id") |
| | | private Long storeId; |
| | | |
| | | @ApiModelProperty(value = "订单状态(1.待付款 2.代发货 3.待收货 4.待评价 5.已完成 6.已取消)") |
| | | private Integer status; |
| | | |
| | | @ApiModelProperty(value = "支付状态(1.未支付 2.已支付)") |
| | | private Integer payStatus; |
| | | |
| | | @ApiModelProperty(value = "用户收货地址id") |
| | | private Long receiverId; |
| | | |
| | | @ApiModelProperty(value = "支付金额") |
| | | private BigDecimal payAmount; |
| | | |
| | | @ApiModelProperty(value = "配送方式") |
| | | private Integer deliveryType; |
| | | |
| | | @ApiModelProperty(value = "订单备注") |
| | | private String remark; |
| | | |
| | | @ApiModelProperty(value = "支付方式(1.微信支付)") |
| | | private Integer payType; |
| | | |
| | | @ApiModelProperty(value = "支付时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date payTime; |
| | | |
| | | @ApiModelProperty(value = "订单发货状态(1.未发货 2.已发货)") |
| | | private Integer deliveryStatus; |
| | | |
| | | @ApiModelProperty(value = "物流公司") |
| | | private String logisticsCompany; |
| | | |
| | | @ApiModelProperty(value = "物流单号") |
| | | private String logisticsNo; |
| | | |
| | | @ApiModelProperty(value = "下单时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date createAt; |
| | | |
| | | @ApiModelProperty(value = "支付单号") |
| | | private String payNo; |
| | | |
| | | @ApiModelProperty(value = "发货时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date deliveryTime; |
| | | |
| | | @ApiModelProperty(value = "订单下商品信息") |
| | | private List<ComShopOrderGoodsVO> orderGoodsVOList; |
| | | |
| | | @ApiModelProperty(value = "订单下店铺信息") |
| | | private PageShopStoreVO shopStoreVO; |
| | | |
| | | @ApiModelProperty(value = "用户收货地址id") |
| | | private ComShopUserAddressVO userAddressVO; |
| | | |
| | | @ApiModelProperty(value = "商品名称") |
| | | private String goodsName; |
| | | |
| | | @ApiModelProperty(value = "订单日志") |
| | | private List<ComShopOrderOperateVO> logs; |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.shop; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @auther lyq |
| | | * @create 2021-04-14 15:02:14 |
| | | * @describe 订单预览返回参数 |
| | | */ |
| | | @Data |
| | | @ApiModel("订单预览返回参数") |
| | | public class ComShopOrderPreviewVO { |
| | | |
| | | /** |
| | | * 用户默认收货地址 |
| | | */ |
| | | @ApiModelProperty(value = "用户默认收货地址") |
| | | private ComShopUserAddressVO userAddressVO; |
| | | |
| | | /** |
| | | * 店铺信息 |
| | | */ |
| | | @ApiModelProperty(value = "店铺信息") |
| | | private PageShopStoreVO shopStoreVO; |
| | | |
| | | /** |
| | | * 待购买商品列表 |
| | | */ |
| | | @ApiModelProperty(value = "待购买商品列表") |
| | | private List<ComShopOrderGoodsVO> orderGoodsList; |
| | | |
| | | /** |
| | | * 订单总金额 |
| | | */ |
| | | @ApiModelProperty(value = "订单总金额") |
| | | private BigDecimal orderTotal; |
| | | |
| | | /** |
| | | * 订单商品总数量 |
| | | */ |
| | | @ApiModelProperty(value = "订单商品总数量") |
| | | private Integer orderGoodsTotal; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.shop; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | |
| | | /** |
| | | * @auther cedoo |
| | | * @create 2021-4-17 17:54:27 |
| | | * @describe 订单表搜索结果类 |
| | | */ |
| | | |
| | | @Data |
| | | @ApiModel("商品订单") |
| | | public class ComShopOrderSearchVO implements Serializable { |
| | | |
| | | @ApiModelProperty("订单id") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty("店铺id") |
| | | private Long storeId; |
| | | |
| | | @ApiModelProperty("店铺名称") |
| | | private String storeName; |
| | | |
| | | @ApiModelProperty("用户id") |
| | | private Long userId; |
| | | |
| | | @ApiModelProperty("用户账号") |
| | | private Long userName; |
| | | |
| | | @ApiModelProperty("订单号") |
| | | private String orderNo; |
| | | |
| | | @ApiModelProperty("支付单号") |
| | | private String payNo; |
| | | |
| | | @ApiModelProperty("微信交易单号") |
| | | private String wxTardeNo; |
| | | |
| | | @ApiModelProperty("订单状态(1.待付款 2.代发货 3.待收货 4.待评价 5.已完成 6.已取消)") |
| | | private Integer status; |
| | | |
| | | @ApiModelProperty("支付状态(1.未支付 2.已支付)") |
| | | private Integer payStatus; |
| | | |
| | | @ApiModelProperty("订单收货人id") |
| | | private Long receiverId; |
| | | |
| | | @ApiModelProperty("收货人") |
| | | private String receiverName; |
| | | |
| | | @ApiModelProperty("电话") |
| | | private String receiverPhone; |
| | | |
| | | @ApiModelProperty("商品") |
| | | private String goodsName; |
| | | |
| | | @ApiModelProperty("订单总金额") |
| | | private BigDecimal totalAmount; |
| | | |
| | | @ApiModelProperty("优惠总金额") |
| | | private BigDecimal discountAmount; |
| | | |
| | | @ApiModelProperty("支付总金额") |
| | | private BigDecimal payAmount; |
| | | |
| | | @ApiModelProperty("支付方式(1.微信支付)") |
| | | private Integer payType; |
| | | |
| | | @ApiModelProperty("支付时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date payTime; |
| | | |
| | | @ApiModelProperty("配送方式(1.商家配送 2.快递物流)") |
| | | private Integer deliveryType; |
| | | |
| | | @ApiModelProperty("订单发货状态(1.未发货 2.已发货)") |
| | | private Integer deliveryStatus; |
| | | |
| | | @ApiModelProperty("物流公司") |
| | | private String logisticsCompany; |
| | | |
| | | @ApiModelProperty("物流单号") |
| | | private String logisticsNo; |
| | | |
| | | @ApiModelProperty("下单时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date createAt; |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.shop; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | @Data |
| | | @ApiModel("订单创建返回参数") |
| | | public class ComShopOrderVO { |
| | | |
| | | @ApiModelProperty(value = "订单号") |
| | | private String orderNo; |
| | | |
| | | @ApiModelProperty(value = "订单ID") |
| | | private Long orderId; |
| | | |
| | | @ApiModelProperty(value = "订单金额") |
| | | private BigDecimal orderTotal; |
| | | |
| | | @ApiModelProperty(value = "请求支付返回参数") |
| | | private String payResult; |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.shop; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * @auther lyq |
| | | * @create 2021-04-14 15:02:14 |
| | | * @describe 用户收获地址信息 |
| | | */ |
| | | @Data |
| | | @ApiModel("用户收获地址信息") |
| | | public class ComShopUserAddressVO { |
| | | |
| | | /** |
| | | * 主键id |
| | | */ |
| | | @ApiModelProperty("用户收获地址id") |
| | | private Long id; |
| | | |
| | | /** |
| | | * 用户id |
| | | */ |
| | | @ApiModelProperty("用户id") |
| | | private Long userId; |
| | | |
| | | /** |
| | | * 收货人名称 |
| | | */ |
| | | @ApiModelProperty("收货人名称") |
| | | private String name; |
| | | |
| | | /** |
| | | * 收货人手机号 |
| | | */ |
| | | @ApiModelProperty("收货人手机号") |
| | | private String phone; |
| | | |
| | | /** |
| | | * 收货人省份编码 |
| | | */ |
| | | @ApiModelProperty("收货人省份编码") |
| | | private String provinceCode; |
| | | |
| | | /** |
| | | * 收货人省份名称 |
| | | */ |
| | | @ApiModelProperty("收货人省份名称") |
| | | private String provinceName; |
| | | |
| | | /** |
| | | * 收货人城市编码 |
| | | */ |
| | | @ApiModelProperty("收货人城市编码") |
| | | private String cityCode; |
| | | |
| | | /** |
| | | * 收货人城市名称 |
| | | */ |
| | | @ApiModelProperty("收货人城市名称") |
| | | private String cityName; |
| | | |
| | | /** |
| | | * 收货人区县编码 |
| | | */ |
| | | @ApiModelProperty("收货人区县编码") |
| | | private String districtCode; |
| | | |
| | | /** |
| | | * 收货人区县名称 |
| | | */ |
| | | @ApiModelProperty("收货人区县名称") |
| | | private String districtName; |
| | | |
| | | /** |
| | | * 收货人详细地址 |
| | | */ |
| | | @ApiModelProperty("收货人详细地址") |
| | | private String detailAddress; |
| | | |
| | | /** |
| | | * 是否是默认地址(1.是 2.否) |
| | | */ |
| | | @ApiModelProperty("是否是默认地址(1.是 2.否)") |
| | | private Integer isDefault; |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.shop; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.panzhihua.common.model.vos.community.ComActVO; |
| | | import com.panzhihua.common.model.vos.community.ComMngStructAreaVO; |
| | | import com.panzhihua.common.model.vos.community.ComMngStructHouseVO; |
| | | import com.panzhihua.common.model.vos.user.ComMngFamilyInfoVO; |
| | | import com.panzhihua.common.validated.AddGroup; |
| | | import com.panzhihua.common.validated.PutGroup; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.Min; |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.NotNull; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Set; |
| | | |
| | | /** |
| | | * @program: springcloud_k8s_panzhihuazhihuishequ |
| | | * @description: 登录用户信息 |
| | | * @author: huang.hongfa weixin hhf9596 qq 959656820 |
| | | * @create: 2020-11-24 09:35 |
| | | **/ |
| | | @Data |
| | | @ApiModel(value = "用户信息") |
| | | public class LoginStoreUserInfoVO { |
| | | |
| | | @ApiModelProperty("user_id") |
| | | private Long userId; |
| | | |
| | | @ApiModelProperty("微信会话密钥") |
| | | private String sessionKey; |
| | | |
| | | @ApiModelProperty("用户在开放平台的唯一标识符") |
| | | private String unionid; |
| | | |
| | | @ApiModelProperty("登录账户") |
| | | private String account; |
| | | |
| | | @ApiModelProperty("登录密码") |
| | | private String password; |
| | | |
| | | @ApiModelProperty("微信小程序唯一标识") |
| | | private String openid; |
| | | |
| | | @ApiModelProperty("手机号") |
| | | private String phone; |
| | | |
| | | @ApiModelProperty("昵称") |
| | | private String nickName; |
| | | |
| | | @ApiModelProperty("真实名字") |
| | | @NotBlank(groups = {AddGroup.class},message = "真实名字不能为空") |
| | | private String name; |
| | | |
| | | @ApiModelProperty("社区id") |
| | | @Min(value = 1,groups = {PutGroup.class},message = "社区id不能为空") |
| | | @NotNull(groups = {PutGroup.class},message = "社区id不能为空") |
| | | private Long communityId; |
| | | |
| | | @ApiModelProperty("社区名字") |
| | | private String communityName; |
| | | |
| | | @ApiModelProperty("性别 1 男 2 女") |
| | | private Integer sex; |
| | | |
| | | @ApiModelProperty("是否社区团队或者党委或系统管理人员 1 是 2 否") |
| | | private Integer ismemberrole; |
| | | |
| | | @ApiModelProperty("生日") |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | private Date birthday; |
| | | |
| | | @ApiModelProperty("头像") |
| | | private String imageUrl; |
| | | |
| | | @ApiModelProperty(value = "用户类型 1 小程序 2 运营平台 3 社区平台") |
| | | private Integer type; |
| | | |
| | | @ApiModelProperty("职业") |
| | | private String job; |
| | | |
| | | @ApiModelProperty("是否志愿者 0否 1 是") |
| | | private Integer isVolunteer; |
| | | |
| | | @ApiModelProperty("是否党员 0 否 1 是") |
| | | private Integer isPartymember; |
| | | |
| | | @ApiModelProperty("1 启用 2 禁用") |
| | | private Integer status; |
| | | |
| | | @ApiModelProperty("创建时间") |
| | | private Date createAt; |
| | | |
| | | @ApiModelProperty("最后登录时间") |
| | | private Date lastLoginTime; |
| | | |
| | | @ApiModelProperty("角色集合") |
| | | private Set<String> roles; |
| | | |
| | | @ApiModelProperty("权限集合") |
| | | private Set<String> permissions; |
| | | |
| | | @ApiModelProperty("人脸采集照片url") |
| | | private String faceUrl; |
| | | |
| | | @ApiModelProperty("驳回原因") |
| | | private String rejectReson; |
| | | |
| | | @ApiModelProperty("身份证号") |
| | | @NotBlank(groups = {AddGroup.class},message = "身份证号不能为空") |
| | | private String idCard; |
| | | |
| | | @ApiModelProperty("标签 多个用,隔开") |
| | | private String tags; |
| | | |
| | | @ApiModelProperty("家庭id") |
| | | private Long familyId; |
| | | |
| | | @ApiModelProperty(value = "分页每页数量",example = "10") |
| | | private Long pageSize; |
| | | |
| | | @ApiModelProperty(value = "分页当前记录数",example = "1") |
| | | private Long pageNum; |
| | | |
| | | @ApiModelProperty("人脸采集审核状态 0 待审核 1 审核通过 2驳回") |
| | | private Integer faceState; |
| | | |
| | | @ApiModelProperty("操作类型 1通过 2驳回 3删除") |
| | | private Integer operationType; |
| | | |
| | | @ApiModelProperty("家庭成员") |
| | | private List<ComMngFamilyInfoVO> comMngFamilyInfoVOS; |
| | | |
| | | @ApiModelProperty("房屋信息") |
| | | private List<ComMngStructHouseVO> comMngStructHouseVOS; |
| | | |
| | | @ApiModelProperty("用户小区id") |
| | | @Min(value = 1,groups = {PutGroup.class},message = "用户小区id不能为空") |
| | | @NotNull(groups = {PutGroup.class},message = "用户小区id不能为空") |
| | | private Long areaId; |
| | | |
| | | @ApiModelProperty("用户所在社区信息") |
| | | private ComActVO comActVO; |
| | | |
| | | @ApiModelProperty("小区信息") |
| | | private ComMngStructAreaVO comMngStructAreaVO; |
| | | |
| | | @ApiModelProperty("0 未申请 1 申请中 2 通过 3 驳回") |
| | | private Integer volunteerStatus; |
| | | |
| | | |
| | | @ApiModelProperty("是否注册 0 否 1 是") |
| | | private Integer isRegister; |
| | | |
| | | @ApiModelProperty("年龄") |
| | | private Integer age; |
| | | |
| | | @ApiModelProperty("政治面貌:1 - 党员;2 - 团员;3 - 群众") |
| | | private Integer politicalOutlook; |
| | | |
| | | |
| | | @ApiModelProperty("用户商铺信息") |
| | | private ShopStoreVO storeInfo; |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.shop; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @auther lyq |
| | | * @create 2021-04-14 15:02:14 |
| | | * @describe 订单统计结果 |
| | | */ |
| | | @Data |
| | | @ApiModel("订单统计结果") |
| | | public class OrderStatisticsVO { |
| | | |
| | | @ApiModelProperty(value = "待付款订单数") |
| | | private Integer paymentNum = 0; |
| | | |
| | | @ApiModelProperty(value = "待发货订单数") |
| | | private Integer deliverNum = 0; |
| | | |
| | | @ApiModelProperty(value = "待收货订单数") |
| | | private Integer receivingNum = 0; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.shop; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @auther llming |
| | | * @describe * @describe 商品VO |
| | | */ |
| | | @Data |
| | | @ApiModel("商品") |
| | | public class PageShopGoodsVO { |
| | | |
| | | @ApiModelProperty("商品id") |
| | | private Long id; |
| | | |
| | | |
| | | @ApiModelProperty("商品分类id") |
| | | private Long typeId; |
| | | |
| | | |
| | | @ApiModelProperty("商品名称") |
| | | private String name; |
| | | |
| | | @ApiModelProperty("商铺名称") |
| | | private String storeName; |
| | | |
| | | @ApiModelProperty("店铺id") |
| | | private Long storeId; |
| | | |
| | | |
| | | @ApiModelProperty("商品主图") |
| | | private String goodsPic; |
| | | |
| | | @ApiModelProperty("商品展示图") |
| | | private String images; |
| | | |
| | | |
| | | @ApiModelProperty("商品状态(1.出售中 2.已下架 3.回收站)") |
| | | private Integer status; |
| | | |
| | | @ApiModelProperty("商品销量") |
| | | private Integer sale; |
| | | |
| | | @ApiModelProperty("商品原价") |
| | | private BigDecimal originalPrice; |
| | | |
| | | @ApiModelProperty("商品现价") |
| | | private BigDecimal price; |
| | | |
| | | |
| | | @ApiModelProperty("商品单位") |
| | | private String unit; |
| | | |
| | | |
| | | @ApiModelProperty("商品排序") |
| | | private Integer order; |
| | | |
| | | @ApiModelProperty("商品总库存") |
| | | private Integer stock; |
| | | |
| | | |
| | | @ApiModelProperty("商品详情") |
| | | private String details; |
| | | |
| | | @ApiModelProperty("商品备注") |
| | | private String remark; |
| | | |
| | | @ApiModelProperty("商品描述") |
| | | private String goodsDescribe; |
| | | |
| | | |
| | | @ApiModelProperty("配送方式(1.商家配送 2.快递物流)") |
| | | private Integer deliveryType; |
| | | |
| | | |
| | | @ApiModelProperty("删除状态(1.未删除 2.已删除)") |
| | | private Integer deleteStatus; |
| | | |
| | | @ApiModelProperty("创建时间") |
| | | private Date createAt; |
| | | |
| | | |
| | | @ApiModelProperty("修改时间") |
| | | private Date updateAt; |
| | | |
| | | @ApiModelProperty("规格") |
| | | private List<AddShopGoodsAttrVO> goodsAttts; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.shop; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | import java.util.List; |
| | | |
| | | |
| | | /** |
| | | * @auther lyq |
| | | * @create 2021-04-14 15:02:14 |
| | | * @describe 店铺VO |
| | | */ |
| | | @Data |
| | | @ApiModel("商城店铺") |
| | | public class PageShopStoreVO { |
| | | |
| | | @ApiModelProperty("商家、联系人") |
| | | private String contacts; |
| | | |
| | | @ApiModelProperty("店铺登陆账号") |
| | | private String storeAccount; |
| | | |
| | | @ApiModelProperty("联系方式") |
| | | private String phone; |
| | | |
| | | |
| | | @ApiModelProperty("店铺状态(1.启用 2.禁用)") |
| | | private Integer status; |
| | | |
| | | @ApiModelProperty("店铺id") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty("店铺名称") |
| | | private String name; |
| | | |
| | | @ApiModelProperty("店铺logo") |
| | | private String logo; |
| | | |
| | | @ApiModelProperty("配送方式(1.商家配送 2.快递物流)") |
| | | private Integer deliveryType; |
| | | |
| | | @ApiModelProperty("创建时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date createAt; |
| | | |
| | | @ApiModelProperty("店铺详情") |
| | | private String storeDetail; |
| | | |
| | | @ApiModelProperty("店铺描述") |
| | | private String storeDescribe; |
| | | |
| | | @ApiModelProperty("店铺销量") |
| | | private Integer sale; |
| | | |
| | | @ApiModelProperty("店铺登陆密码") |
| | | private String storePassword; |
| | | |
| | | @ApiModelProperty("店内商品列表") |
| | | private List<ComShopGoodsVO> goodsList; |
| | | |
| | | @ApiModelProperty("该商家是否订单完成") |
| | | private Boolean orderDone; |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.shop; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @program: springcloud_k8s_panzhihuazhihuishequ |
| | | * @description: 商城后台操作日志 |
| | | * @author: cedoo |
| | | * @create: 2021-4-17 10:11:45 |
| | | **/ |
| | | @Data |
| | | @ApiModel("操作日志") |
| | | public class ShopOperLogVO { |
| | | |
| | | @ApiModelProperty("日志主键") |
| | | private Long operId; |
| | | |
| | | @ApiModelProperty("模块标题") |
| | | private String title; |
| | | |
| | | @ApiModelProperty("业务类型") |
| | | private Integer businessType; |
| | | |
| | | @ApiModelProperty("业务类型名称") |
| | | private String businessName; |
| | | |
| | | @ApiModelProperty("方法名称") |
| | | private String method; |
| | | |
| | | @ApiModelProperty("请求方式") |
| | | private String requestMethod; |
| | | |
| | | @ApiModelProperty("操作类别(0其它 1后台用户 2手机端用户)") |
| | | private Integer operatorType; |
| | | |
| | | @ApiModelProperty("操作人员") |
| | | private String operName; |
| | | |
| | | @ApiModelProperty("部门名称") |
| | | private String deptName; |
| | | |
| | | @ApiModelProperty("请求url") |
| | | private String operUrl; |
| | | |
| | | @ApiModelProperty("主机地址") |
| | | private String operIp; |
| | | |
| | | @ApiModelProperty("操作地点") |
| | | private String operLocation; |
| | | |
| | | @ApiModelProperty("请求参数") |
| | | private String operParam; |
| | | |
| | | @ApiModelProperty("返回参数") |
| | | private String jsonResult; |
| | | |
| | | @ApiModelProperty("操作状态(0正常 1异常)") |
| | | private Integer status; |
| | | |
| | | @ApiModelProperty("错误消息") |
| | | private String errorMsg; |
| | | |
| | | @ApiModelProperty("操作时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date operTime; |
| | | |
| | | @ApiModelProperty("社区id") |
| | | private Long communityId; |
| | | |
| | | @ApiModelProperty("操作账户") |
| | | private String account; |
| | | |
| | | @ApiModelProperty("用户ID") |
| | | private Long userId; |
| | | |
| | | @ApiModelProperty("用户名") |
| | | private String userName; |
| | | |
| | | } |
| | |
| | | package com.panzhihua.common.model.vos.shop; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonIgnore; |
| | | import com.panzhihua.common.validated.AddGroup; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | |
| | | |
| | | |
| | | @ApiModelProperty("店铺登陆账号") |
| | | @Pattern(groups = {AddGroup.class},message="【密码】格式为6-16个字符,英文,数字,且必须包含英文和数字",regexp="^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{6,16}$") |
| | | @NotBlank(message = "店铺登陆账号不能为空") |
| | | private String storeAccount; |
| | | |
| | | |
| | | @ApiModelProperty("店铺登陆密码") |
| | | @NotBlank(message = "店铺登陆密码不能为空") |
| | | @Pattern(groups = {AddGroup.class},message="【密码】格式为6-16个字符,英文,数字,且必须包含英文和数字",regexp="^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{6,16}$") |
| | | private String storePassword; |
| | | |
| | | |
| | |
| | | * 保存时添加sys_user所需 |
| | | */ |
| | | @ApiModelProperty("sysUserId") |
| | | @JsonIgnore |
| | | private Long sysUserId; |
| | | |
| | | @ApiModelProperty(" 店铺状态(1.启用 2.禁用)") |
| | | private Integer status; |
| | | |
| | | /** |
| | | * 当前登陆用户Id |
| | | */ |
| | | @JsonIgnore |
| | | private Long loginUserId; |
| | | |
| | | @ApiModelProperty("id") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty("商家简介") |
| | | @Size(max = 25,min = 1,message = "简介长度不符合!") |
| | | private String storeDescribe; |
| | | |
| | | } |
| | |
| | | @NotBlank(groups = {AddGroup.class},message ="手机号不能为空" ) |
| | | private String phone; |
| | | |
| | | @ApiModelProperty("年龄") |
| | | @Min(value = 1,groups = {AddGroup.class},message ="年龄不能为空" ) |
| | | @ApiModelProperty(value = "年龄",hidden = true) |
| | | private Integer age; |
| | | |
| | | @ApiModelProperty("健康状况") |
| | |
| | | @ApiModelProperty("工作") |
| | | private String job; |
| | | |
| | | @ApiModelProperty("证件照(人像面)照片") |
| | | private String cardPhotoFront; |
| | | |
| | | @ApiModelProperty("证件照(国徽面)照片") |
| | | private String cardPhotoBack; |
| | | |
| | | @ApiModelProperty("户口本照片 逗号隔开") |
| | | private String familyBook; |
| | | |
| | | @ApiModelProperty(value = "create_at",hidden = true) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date createAt; |
| | |
| | | @ApiModelProperty("近一个月离(返)攀情况") |
| | | private String situation; |
| | | |
| | | /** |
| | | * 证件照(人面像)照片 |
| | | */ |
| | | @ApiModelProperty("证件照(人面像)照片") |
| | | private String cardPhotoFront; |
| | | |
| | | /** |
| | | * 证件照(国徽面)照片 |
| | | */ |
| | | @ApiModelProperty("证件照(国徽面)照片") |
| | | private String cardPhotoBack; |
| | | |
| | | /** |
| | | * 户口本照片(多张以,号隔开) |
| | | */ |
| | | @ApiModelProperty("户口本照片(多张以,号隔开)") |
| | | private String familyBook; |
| | | |
| | | |
| | | |
| | |
| | | package com.panzhihua.common.model.vos.user; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.panzhihua.common.model.helper.encrypt.EncryptDecryptClass; |
| | | import com.panzhihua.common.model.helper.encrypt.EncryptDecryptField; |
| | | import com.panzhihua.common.model.helper.sensitive.Sensitive; |
| | | import com.panzhihua.common.model.helper.sensitive.SensitiveStrategy; |
| | | import com.panzhihua.common.model.vos.community.ComMngStructHouseVO; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "居民数据信息") |
| | | @EncryptDecryptClass |
| | | public class InputUserInfoVO implements Serializable { |
| | | |
| | | @ApiModelProperty("用户编号") |
| | |
| | | private Integer maritalStatus; |
| | | |
| | | @ApiModelProperty("联系方式") |
| | | @EncryptDecryptField |
| | | @Sensitive(strategy = SensitiveStrategy.PHONE) |
| | | private String phone; |
| | | |
| | | @ApiModelProperty("文化程度") |
| | |
| | | @ApiModelProperty("消息标题") |
| | | private String title; |
| | | |
| | | @ApiModelProperty("具体业务类型 1 社区活动 2党建活动 3微心愿通知 4随手拍服务通知 5支援者申请 6实名制审核 7人脸识别审核 8积分获取和消耗 9积分点击直接跳转积分列表") |
| | | @ApiModelProperty("具体业务类型 1 社区活动 2党建活动 3微心愿通知 4随手拍服务通知 5支援者申请 6实名制审核 7人脸识别审核 8积分获取和消耗 9积分点击直接跳转积分列表 10 房屋审核通知") |
| | | private Integer businessType; |
| | | |
| | | @ApiModelProperty("业务标题") |
New file |
| | |
| | | package com.panzhihua.common.model.vos.user; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @auther llming |
| | | * @describe |
| | | */ |
| | | @ApiModel("修改用户电子档案") |
| | | @Data |
| | | public class UpdateUserArchivesVO { |
| | | @ApiModelProperty(value = "用户id",hidden = true) |
| | | private Long userId; |
| | | |
| | | @ApiModelProperty("证件照(人像面)照片") |
| | | private String cardPhotoFront; |
| | | |
| | | @ApiModelProperty("证件照(国徽面)照片") |
| | | private String cardPhotoBack; |
| | | |
| | | @ApiModelProperty("户口本照片 逗号隔开") |
| | | private String familyBook; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.user; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @auther llming |
| | | * @describe 用户电子档案 |
| | | */ |
| | | @ApiModel("用户电子档案") |
| | | @Data |
| | | public class UserArchivesVO { |
| | | @ApiModelProperty("用户id") |
| | | private Long userId; |
| | | |
| | | @ApiModelProperty("真实名字") |
| | | private String name; |
| | | |
| | | @ApiModelProperty("身份证号") |
| | | private String idCard; |
| | | |
| | | |
| | | @ApiModelProperty("性别 1 男 2 女") |
| | | private Integer sex; |
| | | |
| | | @ApiModelProperty("出生年月") |
| | | private Date birthday; |
| | | |
| | | @ApiModelProperty("职业") |
| | | private String job; |
| | | |
| | | |
| | | @ApiModelProperty("证件照(人像面)照片") |
| | | private String cardPhotoFront; |
| | | |
| | | @ApiModelProperty("证件照(国徽面)照片") |
| | | private String cardPhotoBack; |
| | | |
| | | @ApiModelProperty("户口本照片 逗号隔开") |
| | | private String familyBook; |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.user; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel("电子档用户信息") |
| | | public class UserElectronicFileVO { |
| | | |
| | | /** |
| | | * 用户id |
| | | */ |
| | | @ApiModelProperty(value = "用户id",hidden = true) |
| | | private Long userId; |
| | | |
| | | /** |
| | | * 证件照(人面像)照片 |
| | | */ |
| | | @ApiModelProperty("证件照(人面像)照片") |
| | | private String cardPhotoFront; |
| | | |
| | | /** |
| | | * 证件照(国徽面)照片 |
| | | */ |
| | | @ApiModelProperty("证件照(国徽面)照片") |
| | | private String cardPhotoBack; |
| | | |
| | | /** |
| | | * 户口本照片(多张以,号隔开) |
| | | */ |
| | | @ApiModelProperty("户口本照片(多张以,号隔开)") |
| | | private String familyBook; |
| | | } |
| | |
| | | */ |
| | | @PostMapping("/refreshToken") |
| | | R refreshToken(@RequestParam("refreshToken")String refreshToken); |
| | | |
| | | /** |
| | | * 商家后台登录 |
| | | * @param account 账户 |
| | | * @param password 密码 |
| | | * @return 登录结果 |
| | | */ |
| | | @PostMapping("/loginShopBackStage") |
| | | R loginShopBackStage(@RequestParam("account") String account, @RequestParam("password")String password); |
| | | } |
| | |
| | | package com.panzhihua.common.service.community; |
| | | |
| | | import com.panzhihua.common.model.dtos.AppletesBackstageConfigDTO; |
| | | import com.panzhihua.common.model.dtos.PageDTO; |
| | | import com.panzhihua.common.model.dtos.advertisement.ComOpsAdvDTO; |
| | | import com.panzhihua.common.model.dtos.advertisement.PageComOpsAdvDTO; |
| | | import com.panzhihua.common.model.dtos.community.*; |
| | | import com.panzhihua.common.model.dtos.shop.PageComShopOrderSearchDTO; |
| | | import com.panzhihua.common.model.dtos.shop.*; |
| | | import com.panzhihua.common.model.dtos.shop.PageComShopGoodsDTO; |
| | | import com.panzhihua.common.model.dtos.shop.PageComShopStoreDTO; |
| | | import com.panzhihua.common.model.dtos.user.PageInputUserDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.SystemmanagementConfigVO; |
| | | import com.panzhihua.common.model.vos.community.*; |
| | | import com.panzhihua.common.model.vos.community.questnaire.EditComActQuestnaireVo; |
| | | import com.panzhihua.common.model.vos.community.questnaire.QuestnaireVO; |
| | | import com.panzhihua.common.model.vos.community.questnaire.UsersAnswerQuestnaireVO; |
| | | import com.panzhihua.common.model.vos.shop.ShopOperLogVO; |
| | | import com.panzhihua.common.model.vos.shop.AddShopGoodsVO; |
| | | import com.panzhihua.common.model.vos.shop.ShopStoreVO; |
| | | import com.panzhihua.common.model.vos.user.UserPhoneVO; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | |
| | | R pageOtherBuild(@RequestBody ComMngStructOtherBuildVO comMngStructOtherBuildVO); |
| | | |
| | | /** |
| | | * 获取志愿者详情 |
| | | * |
| | | * @param id 志愿者信息 |
| | | * @return 增加结果 |
| | | */ |
| | | @GetMapping("getVolunteerById") |
| | | R getVolunteerById(@RequestParam("id")Long id); |
| | | |
| | | /** |
| | | * 增加志愿者 |
| | | * |
| | | * @param comMngVolunteerMngVO 志愿者信息 |
| | |
| | | */ |
| | | @PostMapping("timedtaskactactivityall") |
| | | R timedTaskActActivityAll(); |
| | | |
| | | |
| | | /** |
| | | * 定时任务刷新社区活动的各个状态 除取消外 |
| | | * |
| | | * @return |
| | | */ |
| | | @PostMapping("timedtaskactmicrowishall") |
| | | R timedTaskActMicroWishAll(); |
| | | |
| | | /** |
| | | * 其他建筑详情 |
| | |
| | | R listSavePopulationServeExcelVO(@RequestBody List<ComMngPopulationServeExcelVO> list, @RequestParam(value = "communityId") Long communityId); |
| | | |
| | | /** |
| | | * 确认导入实有人口(有则更新,无则新建) |
| | | * @param list 用户信息 |
| | | * @param communityId 社区id |
| | | * @return 导入结果 |
| | | */ |
| | | @PostMapping("/common/data/population/import/confirm") |
| | | R listSavePopulationConfirm(@RequestBody List<ComMngPopulationServeExcelVO> list, @RequestParam(value = "communityId") Long communityId); |
| | | |
| | | /** |
| | | * 分页查询实有人口 |
| | | * |
| | | * @param comMngPopulationVO 查询参数 |
| | |
| | | */ |
| | | @PostMapping("/common/data/population/detail") |
| | | R detailPopulation(@RequestParam(value = "populationId") Long populationId); |
| | | |
| | | /** |
| | | * 根据id查询实有人口电子档案信息 |
| | | * @param populationId 实有人口id |
| | | * @return 实有人口电子档信息 |
| | | */ |
| | | @PostMapping("/common/data/population/electronicArchives") |
| | | R electronicArchivesPopulation(@RequestParam(value = "populationId") Long populationId); |
| | | |
| | | |
| | | /** |
| | | * 根据id修改实有人口标签列表 |
| | |
| | | @PostMapping("/shop/saveStore") |
| | | R saveStore(@RequestBody ShopStoreVO storeVO); |
| | | |
| | | /** |
| | | * 新增店铺 |
| | | * @param storeVO 店铺信息 |
| | | * @return 新增结果 |
| | | */ |
| | | @PostMapping("/shop/addStore") |
| | | R addStore(@RequestBody ShopStoreVO storeVO); |
| | | |
| | | /** |
| | | * 编辑店铺、启用、禁用 |
| | |
| | | @GetMapping("/shop/getStoreInfo") |
| | | R getStoreInfo(@RequestParam("id")Long id); |
| | | |
| | | |
| | | /** |
| | | * 商品列表-分页查询 |
| | | * @param pageComShopGoodsDTO 添加数据 |
| | | */ |
| | | @PostMapping("/shop/pageGoods") |
| | | R pageGoodsList(@RequestBody PageComShopGoodsDTO pageComShopGoodsDTO); |
| | | |
| | | /** |
| | | * 新增商品 |
| | | * @param addShopGoodsVO |
| | | * @return |
| | | */ |
| | | @PostMapping("/shop/saveShopGoods") |
| | | R saveShopGoods(@RequestBody AddShopGoodsVO addShopGoodsVO); |
| | | |
| | | /** |
| | | * 编辑商品 |
| | | * @param id |
| | | * @param addShopGoodsVO |
| | | * @return |
| | | */ |
| | | @PostMapping("/shop/editShopGoods/{id}") |
| | | R editShopGoods(@PathVariable("id") Long id,@RequestBody AddShopGoodsVO addShopGoodsVO); |
| | | |
| | | /** |
| | | * 删除商品 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @PostMapping("/shop/deleteShopGoods") |
| | | R deleteShopGoods(@RequestBody Long[] id); |
| | | /** |
| | | * 修改商品状态 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @GetMapping("/shop/changeShopGoodsStatus") |
| | | R changeStatus(@RequestParam("id") Long id,@RequestParam("status")Integer status); |
| | | /** |
| | | * 结果 |
| | | * @param shopOperlog 商城后台操作日志 |
| | | */ |
| | | @PostMapping("/shop/addShopOperLog") |
| | | R addShopOperLog(@RequestBody ShopOperLogVO shopOperlog); |
| | | |
| | | /** |
| | | * 分页查询 商家后台操作日志 |
| | | * @param pageDTO 分页数据 |
| | | * @return 分页日志 |
| | | */ |
| | | @PostMapping("/shop/pageShopOperLog") |
| | | R pageShopOperLog(@RequestBody PageDTO pageDTO); |
| | | |
| | | /** |
| | | * 订单分页查询 |
| | | * @param pageComShopOrderSearchDTO 分页数据 |
| | | * @return 订单分页查询 |
| | | */ |
| | | @PostMapping("/shop/order/page") |
| | | R pageShopOrder(@RequestBody PageComShopOrderSearchDTO pageComShopOrderSearchDTO); |
| | | /** |
| | | * 分页查询店铺列表 |
| | | * @param comShopStoreDTO 请求参数 |
| | | * @return 店铺列表 |
| | | */ |
| | | @PostMapping("/shop/pageShopStore") |
| | | R pageShopStore(@RequestBody PageComShopStoreDTO comShopStoreDTO); |
| | | |
| | | /** |
| | | * 根据id查询店铺详情 |
| | | * @param comShopStoreDTO 请求参数 |
| | | * @return 店铺详情 |
| | | */ |
| | | @PostMapping("/shop/shopStoreDetail") |
| | | R shopStoreDetail(@RequestBody PageComShopStoreDTO comShopStoreDTO); |
| | | |
| | | /** |
| | | * 分页查询商品列表 |
| | | * @param comShopGoodsDTO 请求参数 |
| | | * @return 商品列表 |
| | | */ |
| | | @PostMapping("/shop/pageShopGoods") |
| | | R pageShopGoods(@RequestBody ComShopGoodsDTO comShopGoodsDTO); |
| | | |
| | | /** |
| | | * 根据商品id查询商品信息 |
| | | * @param goodsId 商品id |
| | | * @return 商品信息 |
| | | */ |
| | | @PostMapping("/shop/shopGoodsDetail") |
| | | R shopGoodsDetail(@RequestParam("goodsId") Long goodsId); |
| | | |
| | | /** |
| | | * 查询用户购物车列表 |
| | | * @param userId 用户id |
| | | * @return 购物车列表 |
| | | */ |
| | | @PostMapping("/shop/shopCartList") |
| | | R shopCartList(@RequestParam("userId") Long userId); |
| | | |
| | | /** |
| | | * 查询用户购物车数量 |
| | | * @param userId 用户id |
| | | * @return 用户购物车商品数量 |
| | | */ |
| | | @PostMapping("/shop/shopCartUserTotal") |
| | | R shopCartUserTotal(@RequestParam("userId") Long userId); |
| | | |
| | | /** |
| | | * 购物车添加 |
| | | * @param comShopCartDTO 请求参数 |
| | | * @return 购物车列表 |
| | | */ |
| | | @PostMapping("/shop/shopAddCart") |
| | | R shopAddCart(@RequestBody ComShopCartDTO comShopCartDTO); |
| | | |
| | | /** |
| | | * 购物车内商品数量修改 |
| | | * @param shopEditNubCartDTO 请求参数 |
| | | * @return 修改结果 |
| | | */ |
| | | @PostMapping("/shop/shopEditNubCart") |
| | | R shopEditNubCart(@RequestBody ComShopEditNubCartDTO shopEditNubCartDTO); |
| | | |
| | | /** |
| | | * 删除购物车记录 |
| | | * @param Ids 购物车id集合 |
| | | * @return 删除结果 |
| | | */ |
| | | @PostMapping("/shop/shopDelCart") |
| | | R shopDelCart(@RequestBody List<Long> Ids); |
| | | |
| | | /** |
| | | * 分页查询用户收货地址列表 |
| | | * @param comShopAddressDTO 请求参数 |
| | | * @return 用户收货地址列表 |
| | | */ |
| | | @PostMapping("/shop/shopUserAddressList") |
| | | R shopUserAddressList(@RequestBody PageComShopAddressDTO comShopAddressDTO); |
| | | |
| | | /** |
| | | * 用户添加收货地址 |
| | | * @param comShopAddressDTO 请求参数 |
| | | * @return 添加结果 |
| | | */ |
| | | @PostMapping("/shop/shopAddUserAddress") |
| | | R shopAddUserAddress(@RequestBody ComShopAddressDTO comShopAddressDTO); |
| | | |
| | | /** |
| | | * 用户修改收货地址 |
| | | * @param comShopAddressDTO 请求参数 |
| | | * @return 修改结果 |
| | | */ |
| | | @PostMapping("/shop/shopEditUserAddress") |
| | | R shopEditUserAddress(@RequestBody ComShopAddressDTO comShopAddressDTO); |
| | | |
| | | /** |
| | | * 用户删除收货地址 |
| | | * @param addressId 收货地址id |
| | | * @return 删除结果 |
| | | */ |
| | | @PostMapping("/shop/shopDelUserAddress") |
| | | R shopDelUserAddress(@RequestParam("addressId") Long addressId); |
| | | |
| | | /** |
| | | * 订单预览 |
| | | * @param orderPreviewDTO 请求参数 |
| | | * @return 订单预览数据 |
| | | */ |
| | | @PostMapping("/shop/orderPreview") |
| | | R orderPreview(@RequestBody ComShopOrderPreviewDTO orderPreviewDTO); |
| | | |
| | | /** |
| | | * 创建订单 |
| | | * @param orderCreateDTO 创建订单请求参数 |
| | | * @return 创建结果 |
| | | */ |
| | | @PostMapping("/shop/orderCreate") |
| | | R orderCreate(@RequestBody ComShopOrderCreateDTO orderCreateDTO); |
| | | |
| | | /** |
| | | * 分页查询用户订单列表 |
| | | * @param comOrderListDTO 请求参数 |
| | | * @return 查询结果 |
| | | */ |
| | | @PostMapping("/shop/pageOrderList") |
| | | R pageOrderList(@RequestBody PageComOrderListDTO comOrderListDTO); |
| | | |
| | | /** |
| | | * 根据订单id查询订单详情 |
| | | * @param orderId 订单id |
| | | * @return 订单详情 |
| | | */ |
| | | @PostMapping("/shop/orderDetail") |
| | | R orderDetail(@RequestParam("orderId") Long orderId); |
| | | |
| | | /** |
| | | * 根据订单id取消订单 |
| | | * @param comShopOrderQueryDTO 请求参数 |
| | | * @return 取消结果 |
| | | */ |
| | | @PostMapping("/shop/orderCancel") |
| | | R orderCancel(@RequestBody ComShopOrderQueryDTO comShopOrderQueryDTO); |
| | | |
| | | /** |
| | | * 根据订单id删除订单 |
| | | * @param orderId 订单id |
| | | * @return 删除结果 |
| | | */ |
| | | @PostMapping("/shop/orderDelete") |
| | | R orderDelete(@RequestParam("orderId") Long orderId); |
| | | |
| | | /** |
| | | * 根据订单id确认收货 |
| | | * @param comShopOrderQueryDTO 请求参数 |
| | | * @return 确认结果 |
| | | */ |
| | | @PostMapping("/shop/orderConfirm") |
| | | R orderConfirm(@RequestBody ComShopOrderQueryDTO comShopOrderQueryDTO); |
| | | |
| | | /** |
| | | * 统计用户订单数量 |
| | | * @param userId 用户id |
| | | * @return 统计结果 |
| | | */ |
| | | @PostMapping("/shop/orderStatistics") |
| | | R orderStatistics(@RequestParam("userId") Long userId); |
| | | |
| | | /** |
| | | * 商家资金的订单详情 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @GetMapping("/shop/capitalDetailByStore") |
| | | R capitalDetailByStore(@RequestParam("id") Long id); |
| | | |
| | | |
| | | /** |
| | | * 订单发货 |
| | | * @param orderShipDTO 商城订单发货信息 |
| | | * @return 发货结果 |
| | | */ |
| | | @PostMapping("/shop/shipOrder") |
| | | R shipOrder(@RequestBody ComShopOrderShipDTO orderShipDTO); |
| | | |
| | | /** |
| | | * 订单配送 |
| | | * @param deliverDTO 订单信息 |
| | | * @return 配送结果 |
| | | */ |
| | | @PostMapping("/shop/deliverOrder") |
| | | R deliverOrder(@RequestBody ComShopOrderDeliverDTO deliverDTO); |
| | | |
| | | /** |
| | | * 订单完成配送 |
| | | * @param deliverDTO 订单信息 |
| | | * @return 配送完成结果 |
| | | */ |
| | | @PostMapping("/shop/finishDeliverOrder") |
| | | R finishDeliverOrder(@RequestBody ComShopOrderDeliverDTO deliverDTO); |
| | | |
| | | /** |
| | | * 获取用户商户详情 |
| | | * @param userId 用户ID |
| | | */ |
| | | @GetMapping("/shop/getUserStoreInfo") |
| | | R getUserStoreInfo(@RequestParam("userId") Long userId); |
| | | |
| | | /** |
| | | * 获取用户商户详情 |
| | | * @param account 用户账号 |
| | | */ |
| | | @GetMapping("/shop/getUserStoreInfoByAccount") |
| | | R<ShopStoreVO> getUserStoreInfoByAccount(@RequestParam("account") String account); |
| | | |
| | | /** |
| | | * 订单导出信息 |
| | | * @param comShopOrderExportDTO 订单导出信息 |
| | | * @return 订单导出信息 |
| | | */ |
| | | @PostMapping("/shop/shopOrderExportData") |
| | | R shopOrderExportData(@RequestBody ComShopOrderExportDTO comShopOrderExportDTO); |
| | | |
| | | /** |
| | | * 资金管理导出信息 |
| | | * @param comShopFundsExportDTO 资金管理导出信息 |
| | | * @return 资金管理导出信息 |
| | | */ |
| | | @PostMapping("/shop/shopOrderFundsExportData") |
| | | R shopOrderFundsExportData(@RequestBody ComShopFundsExportDTO comShopFundsExportDTO ); |
| | | |
| | | /** |
| | | * 店铺资金统计信息 |
| | | * @param userId 用户ID |
| | | * @return 店铺资金统计信息 |
| | | */ |
| | | @GetMapping("/shop/getFundsStat") |
| | | R getFundsStat(@RequestParam("userId") Long userId); |
| | | |
| | | /** |
| | | * 店铺资金统计信息 |
| | | * @param pageComShopFundsSearchDTO 店铺资金 |
| | | * @return 店铺资金统计信息 |
| | | */ |
| | | @PostMapping("/shop/pageShopFunds") |
| | | R pageShopFunds(@RequestBody PageComShopFundsSearchDTO pageComShopFundsSearchDTO); |
| | | |
| | | /** |
| | | * 微信支付订单回调 |
| | | * @param wxPayNotifyOrderDTO 订单支付回调参数 |
| | | */ |
| | | @PostMapping("/shop/wxOrderPayNotify") |
| | | void wxOrderPayNotify(@RequestBody WxPayNotifyOrderDTO wxPayNotifyOrderDTO); |
| | | |
| | | /** |
| | | * 点击去支付订单 |
| | | * @param orderPayDTO 请求参数 |
| | | * @return 支付对象 |
| | | */ |
| | | @PostMapping("/shop/wxPay") |
| | | R wxPay(@RequestBody OrderPayDTO orderPayDTO); |
| | | |
| | | /** |
| | | * 编辑实有人口 |
| | | * @param editComMngPopulationVO |
| | | * @return |
| | | */ |
| | | @PostMapping("/common/data/population/edit") |
| | | R editPopulation(@RequestBody EditComMngPopulationVO editComMngPopulationVO, @RequestParam("communityId") Long communityId); |
| | | |
| | | /** |
| | | * 微心愿删除 |
| | | * @param id 微心愿id |
| | | */ |
| | | @PostMapping("deletemicrowish") |
| | | R deletemicrowish(@RequestParam("id")Long id); |
| | | |
| | | /** |
| | | * 基础数据》特殊群体》分页查询 |
| | | * @param pageInputUserDTO |
| | | * @return |
| | | */ |
| | | @PostMapping("common/data/special/page") |
| | | R specialInputUser(@RequestBody PageInputUserDTO pageInputUserDTO); |
| | | |
| | | /** |
| | | * 删除特殊群体人员 |
| | | * @param id 特殊群体id |
| | | * @return 删除结果 |
| | | */ |
| | | @PostMapping("common/data/special/delete") |
| | | R deleteSpecialInputUser(@RequestParam(value = "id") Long id); |
| | | |
| | | |
| | | /** |
| | | * 办事指南_新增 |
| | | * @param workGuideVO 新增信息 |
| | | * @return 新增结果 |
| | | */ |
| | | @PostMapping("/addworkguide") |
| | | R addWorkGuide(@RequestBody ComActWorkGuideVO workGuideVO, @RequestParam("userId")Long userId); |
| | | |
| | | /** |
| | | * 办事指南_编辑 |
| | | * @param workGuideVO |
| | | * @return 编辑结果 |
| | | */ |
| | | @PostMapping("/editworkguide") |
| | | R editWorkGuide(@RequestBody ComActWorkGuideVO workGuideVO, @RequestParam("userId")Long userId); |
| | | |
| | | /** |
| | | * 办事指南_详情 |
| | | * @param workGuideId |
| | | * @return 详情 |
| | | */ |
| | | @GetMapping("/detailworkguide") |
| | | R detailWorkGuide(@RequestParam("workGuideId")Long workGuideId); |
| | | /** |
| | | * 办事指南_分页 |
| | | * @param pageActWorkGuideDTO 查询参数 |
| | | * @return 分页集合 |
| | | */ |
| | | @PostMapping("/pageworkguide") |
| | | R pageWorkGuide(@RequestBody PageActWorkGuideDTO pageActWorkGuideDTO); |
| | | |
| | | /** |
| | | * 办事指南_删除 |
| | | * @param workGuideId 办事指南id |
| | | * @return 删除结果 |
| | | */ |
| | | @PostMapping("/delectworkguide") |
| | | R delectWorkGuide(@RequestParam("workGuideId") Long workGuideId); |
| | | |
| | | } |
| | |
| | | import com.panzhihua.common.model.vos.MenuVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.SystemmanagementConfigVO; |
| | | import com.panzhihua.common.model.vos.shop.ShopStoreVO; |
| | | import com.panzhihua.common.model.vos.user.*; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | */ |
| | | @PostMapping("putuserisvolunteer") |
| | | R putUserIsVolunteer(@RequestParam("phone") String phone,@RequestParam("type")int type); |
| | | |
| | | |
| | | /** |
| | | * 修改用户志愿者状态 |
| | | * @param userId 用户ID |
| | | * @param type 1 支援者 0不是志愿者 |
| | | */ |
| | | @PostMapping("putuserisvolunteerbyid") |
| | | R putUserIsVolunteerById(@RequestParam("userId") Long userId,@RequestParam("type")int type); |
| | | |
| | | /** |
| | | * 用户绑定社区、小区 |
| | |
| | | @GetMapping("getUserByPhone") |
| | | R getSysUserVOByPhone(@RequestParam(value = "phone") String phone); |
| | | |
| | | /** |
| | | * 通过账号查询用户信息 |
| | | * @param account |
| | | * @return |
| | | */ |
| | | @GetMapping("getUserByAccount") |
| | | R getSysUserVOByAccountAndType(@RequestParam(value = "account") String account,@RequestParam(value = "type") Integer type); |
| | | |
| | | |
| | | /** |
| | | * 基础数据》居民管理》居民列表 |
| | |
| | | * @return |
| | | */ |
| | | @PostMapping("common/data/special/tags/page") |
| | | R specialInputUserTags(@RequestBody ComMngUserTagDTO comMngUserTagDTO); |
| | | R specialInputUserTags(@RequestBody PageInputUserDTO comMngUserTagDTO); |
| | | |
| | | /** |
| | | * 新增或修改特殊群体标签 |
| | |
| | | */ |
| | | @PostMapping("listtag/getTag") |
| | | R listTags(@RequestParam("communityId") Long communityId); |
| | | |
| | | /** |
| | | * 添加SysUser信息 |
| | | * @param storeVO sysUser信息 |
| | | * @return 添加sysUser结果 |
| | | */ |
| | | @PostMapping("addSysUser") |
| | | R addSysUser(@RequestBody ShopStoreVO storeVO); |
| | | |
| | | /** |
| | | * 修改SysUser信息 |
| | | * @param storeVO sysUser信息 |
| | | * @return 修改结果 |
| | | */ |
| | | @PostMapping("editSysUser") |
| | | R editSysUser(@RequestBody ShopStoreVO storeVO); |
| | | |
| | | /** |
| | | * 修改用户小程序首页活动提示 |
| | | * @param userEditTipsDTO 请求参数 |
| | | * @return 修改结果 |
| | | */ |
| | | @PostMapping("editUserTips") |
| | | R editUserTips(@RequestBody SysUserEditTipsDTO userEditTipsDTO); |
| | | |
| | | /** |
| | | * 获取用户电子档案 |
| | | * @param userId 家庭成员信息 |
| | | * @return 结果 |
| | | */ |
| | | @GetMapping("getUserArchives") |
| | | R getUserArchives(@RequestParam("userId") Long userId); |
| | | |
| | | /** |
| | | * 编辑用户电子档案 |
| | | * @param userArchivesVO 编辑的信息 |
| | | * @return 编辑结果 |
| | | */ |
| | | @PostMapping("updateUserArchives") |
| | | R updateUserArchives(@RequestBody UpdateUserArchivesVO userArchivesVO); |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.utlis; |
| | | |
| | | import com.panzhihua.common.model.dtos.shop.PageComShopOrderSearchDTO; |
| | | |
| | | import java.lang.reflect.Field; |
| | | import java.text.DecimalFormat; |
| | | import java.util.Arrays; |
| | | |
| | | /** |
| | | * 工具类 |
| | | */ |
| | | public class ClazzUtils { |
| | | |
| | | /** |
| | | * 如果string属性为“”, 则将其设置为NULL |
| | | * @param o |
| | | */ |
| | | public static void setIfStringIsEmpty(Object o){ |
| | | if(o==null){ |
| | | return; |
| | | } |
| | | Class clazz = o.getClass(); |
| | | Field[] fields = clazz.getDeclaredFields(); |
| | | Arrays.stream(fields).forEach(field -> { |
| | | if(String.class == field.getType()){ |
| | | try { |
| | | field.setAccessible(true); |
| | | if(field.get(o)!=null) { |
| | | String oVal = (String) field.get(o); |
| | | if ("".equals(oVal)) { |
| | | field.set(o, null); |
| | | } |
| | | } |
| | | } catch (IllegalAccessException e) { |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | |
| | | public static void main(String[] args){ |
| | | PageComShopOrderSearchDTO dto = new PageComShopOrderSearchDTO(); |
| | | dto.setGoodsName(""); |
| | | dto.setOrderNo("123"); |
| | | setIfStringIsEmpty(dto); |
| | | System.out.println(dto); |
| | | |
| | | double d = 1234.200; |
| | | DecimalFormat df = new DecimalFormat("0.00"); |
| | | System.out.println(df.format(d)); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.utlis; |
| | | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.time.*; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.Calendar; |
| | | import java.util.Date; |
| | | |
| | | @Slf4j |
| | | public class DateUtils { |
| | | |
| | | |
| | | public static DateTimeFormatter format_ymdhms = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); |
| | | |
| | | private static DateTimeFormatter format_ymdhmssss = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss.SSS"); |
| | | |
| | | private static DateTimeFormatter format_ymds = DateTimeFormatter.ofPattern("yyyyMMdd"); |
| | | |
| | | public static DateTimeFormatter format_ymd = DateTimeFormatter.ofPattern("yyyy-MM-dd"); |
| | | |
| | | public static DateTimeFormatter format_ymdhms_string = DateTimeFormatter.ofPattern("yyyyMMddHHmmss"); |
| | | |
| | | public static DateTimeFormatter format_ymdhms_no_signal = DateTimeFormatter.ofPattern("yyyyMMddHHmmss"); |
| | | |
| | | public static SimpleDateFormat yyyyMMdd_format = new SimpleDateFormat("yyyy-MM-dd"); |
| | | |
| | | public static SimpleDateFormat yyyy_MM_dd_format = new SimpleDateFormat("yyyy/MM/ddHH:mm:ss"); |
| | | |
| | | public static SimpleDateFormat ymdhms_format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | |
| | | public static DateTimeFormatter format_ymd_String = DateTimeFormatter.ofPattern("yyMMdd"); |
| | | |
| | | |
| | | |
| | | /** |
| | | * 将日期对象格式化成指定的字符串格式 |
| | | * |
| | | * @param date 日期对象 |
| | | * @param formatString 格式化字符串 |
| | | * @return String |
| | | */ |
| | | public static String getDateFormatString(Date date, String formatString) { |
| | | |
| | | String dateString = ""; |
| | | SimpleDateFormat format = new SimpleDateFormat(formatString); |
| | | if (date != null) { |
| | | dateString = format.format(date); |
| | | } |
| | | return dateString; |
| | | } |
| | | |
| | | /** |
| | | * 字符串转date |
| | | * @param date 时间戳 |
| | | * @param format format |
| | | * @return 时间 |
| | | */ |
| | | public static Date stringToDate(String date,SimpleDateFormat format){ |
| | | try { |
| | | if(StringUtils.isBlank(date)){ |
| | | return null; |
| | | } |
| | | return format.parse(date); |
| | | } catch (ParseException e) { |
| | | log.error(e.getMessage(),e); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 字符串转date |
| | | * @param date 时间戳 |
| | | * @return 时间 |
| | | */ |
| | | public static Date stringToDateStandard (String date){ |
| | | SimpleDateFormat format = ymdhms_format; |
| | | if(StringUtils.isNotBlank(date)){ |
| | | if(date.split("-").length==3){ |
| | | if(date.split(":").length!=3){ |
| | | format = yyyyMMdd_format; |
| | | } |
| | | }else if(date.split("-").length==2){ |
| | | format = new SimpleDateFormat("yyyy-MM"); |
| | | } |
| | | try { |
| | | return format.parse(date); |
| | | } catch (ParseException e) { |
| | | log.error(e.getMessage(),e); |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | /** |
| | | * 字符串转date |
| | | * @param date 时间戳 |
| | | * @return 时间 |
| | | */ |
| | | public static Date stringToDateStandardByYYYY_MM_dd (String date){ |
| | | SimpleDateFormat format = yyyy_MM_dd_format; |
| | | if(StringUtils.isNotBlank(date)){ |
| | | try { |
| | | return format.parse(date); |
| | | } catch (ParseException e) { |
| | | log.error(e.getMessage(),e); |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取当前时间 |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | public static LocalDateTime getCurrentDate(){ |
| | | LocalDateTime now = LocalDateTime.now(); |
| | | return now; |
| | | } |
| | | |
| | | /** |
| | | * 获取当前时间字符串,格式为yyyy-MM-dd HH:mm:ss |
| | | * @return |
| | | */ |
| | | public static String getCurrentDateStr(){ |
| | | String nowtime=getCurrentDate().format(format_ymdhms); |
| | | return nowtime; |
| | | } |
| | | |
| | | public static String getCurrentDateymd(){ |
| | | String nowtime=getCurrentDate().format(format_ymdhms_string); |
| | | return nowtime; |
| | | } |
| | | |
| | | public static String getCurrentDateyymd(){ |
| | | String nowtime=getCurrentDate().format(format_ymd_String); |
| | | return nowtime; |
| | | } |
| | | |
| | | /** |
| | | * 获取当前时间字符串,格式为yyyyMMdd |
| | | * @return |
| | | */ |
| | | public static String getCurrentDateString(){ |
| | | String nowtime=getCurrentDate().format(format_ymds); |
| | | return nowtime; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取当前时间字符串,格式为yyyy-MM-dd |
| | | * @return |
| | | */ |
| | | public static String getCurrentDateStrymd(){ |
| | | String nowtime=getCurrentDate().format(format_ymd); |
| | | return nowtime; |
| | | } |
| | | |
| | | public static String getCurrentDateStr_MS(){ |
| | | String nowtime=getCurrentDate().format(format_ymdhmssss); |
| | | return nowtime; |
| | | } |
| | | |
| | | /** |
| | | * 获取当前时间long值 |
| | | * @return |
| | | */ |
| | | public static long getCurrentDataLong(){ |
| | | return new Date().getTime(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 获取当前时间 |
| | | * @param format |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | public static Date getCurrentDate(SimpleDateFormat format){ |
| | | String tempDate = format.format(new Date()); |
| | | try { |
| | | return format.parse(tempDate); |
| | | } catch (ParseException e) { |
| | | log.error(e.getMessage(),e); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | /** |
| | | * @param date |
| | | * @param newFormat |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | public static Date getDate(Date date, SimpleDateFormat newFormat) { |
| | | String tempDate = newFormat.format(date); |
| | | try { |
| | | return newFormat.parse(tempDate); |
| | | } catch (ParseException e) { |
| | | log.error(e.getMessage(),e); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public static String format(Date date, SimpleDateFormat format) { |
| | | if(null == date){ |
| | | return ""; |
| | | } |
| | | return format.format(date); |
| | | } |
| | | |
| | | /** |
| | | * 将给定的时间秒转换为中文格式的时分秒 |
| | | * |
| | | * @param second |
| | | * @return |
| | | */ |
| | | public static String formatSecond_ZH_HMS(Integer second) { |
| | | String result = "0秒"; |
| | | if (null != second) { |
| | | int hours = (int) (second / (60 * 60)); |
| | | int minutes = (int) (second / 60 - hours * 60); |
| | | int seconds = (int) (second - minutes * 60 - hours * 60 * 60); |
| | | |
| | | String format; |
| | | Object[] array; |
| | | |
| | | if (hours > 0) { |
| | | format = "%1$,d时%2$,d分%3$,d秒"; |
| | | array = new Object[]{hours, minutes, seconds}; |
| | | } else if (minutes > 0) { |
| | | format = "%1$,d分%2$,d秒"; |
| | | array = new Object[]{minutes, seconds}; |
| | | } else { |
| | | format = "%1$,d秒"; |
| | | array = new Object[]{seconds}; |
| | | } |
| | | result = String.format(format, array); |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | /** |
| | | * 对日期进行加法操作 |
| | | * |
| | | * @param date |
| | | * @param days |
| | | * @return |
| | | */ |
| | | public static Date addDay(Date date, Integer days) { |
| | | if (null != date) { |
| | | Calendar cal = Calendar.getInstance(); |
| | | cal.setTime(date); |
| | | cal.add(Calendar.DATE, days); |
| | | return cal.getTime(); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | /** |
| | | * 对日期进行加法操作 |
| | | * |
| | | * @param date |
| | | * @param month |
| | | * @return |
| | | */ |
| | | public static Date addMonth(Date date, Integer month) { |
| | | if (null != date) { |
| | | Calendar cal = Calendar.getInstance(); |
| | | cal.setTime(date); |
| | | cal.add(Calendar.MONTH, month); |
| | | return cal.getTime(); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | /** |
| | | * 对日期进行加法操作 |
| | | * @param date |
| | | * @param hours |
| | | * @return |
| | | */ |
| | | public static Date addHours(Date date, Integer hours) { |
| | | if (null != date) { |
| | | Calendar cal = Calendar.getInstance(); |
| | | cal.setTime(date); |
| | | cal.add(Calendar.HOUR_OF_DAY, hours); |
| | | return cal.getTime(); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | /** |
| | | * 对日期的分钟进行加法操作 |
| | | * @param date |
| | | * @param minutes |
| | | * @return |
| | | */ |
| | | public static Date addMinutes(Date date, Integer minutes) { |
| | | if (null != date) { |
| | | Calendar cal = Calendar.getInstance(); |
| | | cal.setTime(date); |
| | | cal.add(Calendar.MINUTE, minutes); |
| | | return cal.getTime(); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | /** |
| | | * 比较两个日期的大小 |
| | | * |
| | | * @param date1 |
| | | * @param date2 |
| | | * @return 日期相等,返回0;前者大,返回1;后者大,返回-1; |
| | | */ |
| | | public static int dateCompare(Date date1, Date date2) { |
| | | Calendar c1 = Calendar.getInstance(); |
| | | c1.setTime(date1); |
| | | |
| | | Calendar c2 = Calendar.getInstance(); |
| | | c2.setTime(date2); |
| | | |
| | | return c1.compareTo(c2); |
| | | } |
| | | |
| | | /** |
| | | * 判断当前日期是否在指定日期区域内(包含起止日期) [startDate,endDate] |
| | | * <p/> |
| | | * [null,null] --> return 1; |
| | | * |
| | | * @param now |
| | | * @param startDate |
| | | * @param endDate |
| | | * @return -1:超出并小于startDate;0:在范围内;1:超出并大于endDate; |
| | | */ |
| | | public static int validateDate(Date now, Date startDate, Date endDate) { |
| | | if (null == startDate && null == endDate) { |
| | | return 0; |
| | | } |
| | | if (null == startDate) { |
| | | //当前时间大于endDate |
| | | if (dateCompare(now, endDate) == 1) { |
| | | return 1; |
| | | } else { |
| | | return 0; |
| | | } |
| | | } else { |
| | | if (null == endDate) { |
| | | //当前时间小于startDate |
| | | if (dateCompare(startDate, now) == 1) { |
| | | return -1; |
| | | } else { |
| | | return 0; |
| | | } |
| | | } else { |
| | | if (dateCompare(startDate, now) == 1) { |
| | | return -1; |
| | | } else if (dateCompare(now, endDate) == 1) { |
| | | return 1; |
| | | } else { |
| | | return 0; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 计算两个日期先差多少秒 |
| | | * @param pre 前一个日期 |
| | | * @param after 后一个日期 |
| | | * @return |
| | | */ |
| | | public static long calTimeDifference(Date pre,Date after){ |
| | | return (after.getTime()-pre.getTime())/1000; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 计算两个时间相差的天数 |
| | | * @param stardate |
| | | * @param enddate |
| | | * @return |
| | | */ |
| | | public static int getHour(Date stardate,Date enddate){ |
| | | long nd = 1000 * 24 * 60 * 60; |
| | | long nh = 1000 * 60 * 60; |
| | | long nm = 1000 * 60; |
| | | long diff=enddate.getTime()-stardate.getTime(); |
| | | |
| | | long day = diff / nd; |
| | | |
| | | long hour = diff % nd / nh; |
| | | |
| | | long min = diff % nd % nh / nm; |
| | | |
| | | return (int)day; |
| | | } |
| | | |
| | | /** |
| | | * 结束时间与当前时间计算相差的月数 |
| | | * @param enddate |
| | | * @return |
| | | */ |
| | | public static int getMonthSpace(String enddate, DateTimeFormatter format) { |
| | | LocalDate formatted = LocalDate.parse(enddate,format); |
| | | LocalDate today = LocalDate.now(); |
| | | Period per = Period.between(today,formatted); |
| | | if(per.getYears() == 0 ){ |
| | | return per.getMonths(); |
| | | }else if(per.getYears() > 0 ){ |
| | | return (per.getYears() * 12) + per.getMonths(); |
| | | } |
| | | |
| | | return (per.getYears() * 12) + per.getMonths(); |
| | | } |
| | | |
| | | /** |
| | | * 获取某个时间段之前的时间点 |
| | | * @return |
| | | */ |
| | | public static String getSomeTimeStapStr(String sign){ |
| | | LocalDateTime beginDateTime =null; |
| | | if (sign.equals("day")) {//一天前时间 |
| | | beginDateTime =LocalDateTime.now().minusDays(1L); |
| | | }else if(sign.equals("week")){ |
| | | beginDateTime =LocalDateTime.now().minusWeeks(1L); |
| | | }else if (sign.equals("month")) { |
| | | beginDateTime =LocalDateTime.now().minusMonths(1L); |
| | | }else if (sign.equals("year")) { |
| | | beginDateTime =LocalDateTime.now().minusYears(1L); |
| | | } |
| | | String beginTime=beginDateTime.format(format_ymdhms); |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | try { |
| | | long timestap = sdf.parse(beginTime).getTime(); |
| | | beginTime = timestap+""; |
| | | } catch (ParseException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return beginTime; |
| | | } |
| | | |
| | | public static String getSomeTimeDateStr(String sign){ |
| | | String beginTime=""; |
| | | LocalDateTime beginDateTime =null; |
| | | if (sign.equals("day")) {//一天前时间 |
| | | beginDateTime =LocalDateTime.now().minusDays(1L); |
| | | }else if(sign.equals("week")){ |
| | | beginDateTime =LocalDateTime.now().minusWeeks(1L); |
| | | }else if (sign.equals("month")) { |
| | | beginDateTime =LocalDateTime.now().minusMonths(1L); |
| | | }else if (sign.equals("year")) { |
| | | beginDateTime =LocalDateTime.now().minusYears(1L); |
| | | } |
| | | if (beginDateTime!=null) { |
| | | beginTime = beginDateTime.format(format_ymdhms); |
| | | } |
| | | return beginTime; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取失效时间点(在什么时间失效) |
| | | * @param minutes 有效分钟数 |
| | | * @return |
| | | */ |
| | | public static LocalDateTime getInvalidLocalDateTime(Long minutes){ |
| | | return LocalDateTime.now().minusMinutes(minutes); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取当前年份 |
| | | * @return |
| | | */ |
| | | public static String getCurrentYear(){ |
| | | Calendar instance = Calendar.getInstance(); |
| | | return instance.get(Calendar.YEAR)+""; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取当前月份 |
| | | * @return |
| | | */ |
| | | public static String getCurrentMonth(){ |
| | | Calendar instance = Calendar.getInstance(); |
| | | int month = instance.get(Calendar.MONTH); |
| | | String result; |
| | | if (month < 10){ |
| | | result = "0" + month; |
| | | }else { |
| | | result = month+""; |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | /** 获取无符号的当前时间 |
| | | * @return |
| | | */ |
| | | public static String getCurrentDateStrNoSignal(){ |
| | | return getCurrentDate().format(format_ymdhms_no_signal); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取前几个小时的时间 |
| | | * @param hours |
| | | * @return |
| | | */ |
| | | public static String getNextHourDateStrNoSignal(long hours){ |
| | | return LocalDateTime.now().plusHours(hours).format(format_ymdhms_no_signal); |
| | | } |
| | | |
| | | |
| | | public static Date localDateTimeToDate(LocalDateTime localDateTime) { |
| | | ZoneId zone = ZoneId.systemDefault(); |
| | | Instant instant = localDateTime.atZone(zone).toInstant(); |
| | | return Date.from(instant); |
| | | } |
| | | |
| | | /** |
| | | * 小时取整 |
| | | * @param date |
| | | * @param hour |
| | | * @return |
| | | */ |
| | | public static Date integralHour(Date date,Integer hour) { |
| | | if(date==null||hour==null){ |
| | | return null; |
| | | } |
| | | long l = date.getTime()- 1; |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:00:00"); |
| | | try { |
| | | Date parse = sdf.parse(sdf.format(new Date(l))); |
| | | return addHours(parse, hour); |
| | | } catch (ParseException e) { |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 分钟取整 |
| | | * 以十分钟为单位 ,去除尾端,加上 参数 46->40+minutes*10 |
| | | * @param date |
| | | * @param minutes |
| | | * @return |
| | | */ |
| | | public static Date integral10Min(Date date,Integer minutes) { |
| | | if(date==null||minutes==null){ |
| | | return null; |
| | | } |
| | | Calendar cal = Calendar.getInstance(); |
| | | cal.setTime(date); |
| | | int i = cal.get(Calendar.MINUTE);//获取分钟 |
| | | if(i%10==0){ |
| | | minutes--; |
| | | } |
| | | minutes=minutes*10-i%10; |
| | | long l = date.getTime()- 1; |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:00"); |
| | | try { |
| | | Date parse = sdf.parse(sdf.format(new Date(l))); |
| | | return addMinutes(parse, minutes); |
| | | } catch (ParseException e) { |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 天数取整 |
| | | * @param date |
| | | * @param day |
| | | * @return |
| | | */ |
| | | public static Date integralDay(Date date,Integer day) { |
| | | if(date==null||day==null){ |
| | | return null; |
| | | } |
| | | long l = date.getTime()- 1; |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd 00:00:00"); |
| | | try { |
| | | Date parse = sdf.parse(sdf.format(new Date(l))); |
| | | return addDay(parse, day); |
| | | } catch (ParseException e) { |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | public static void main(String[]args)throws Exception{ |
| | | // Date date= new Date(); |
| | | // Date after = new Date(); |
| | | // System.out.println(calTimeDifference(date,after)); |
| | | |
| | | } |
| | | } |
| | | |
New file |
| | |
| | | package com.panzhihua.common.utlis; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @Author: llming |
| | | * @Description: 获取不同两个list不同元素 |
| | | */ |
| | | public class DifferentLongListUtil { |
| | | public static List<Long> getDiffrent(List<Long> list1, List<Long> list2) { |
| | | Map<Long, Integer> map = new HashMap<Long, Integer>(list1.size() + list2.size()); |
| | | List<Long> diff = new ArrayList<Long>(); |
| | | List<Long> maxList = list1; |
| | | List<Long> minList = list2; |
| | | if (list2.size() > list1.size()) { |
| | | maxList = list2; |
| | | minList = list1; |
| | | } |
| | | |
| | | for (Long Long : maxList) { |
| | | map.put(Long, 1); |
| | | } |
| | | |
| | | for (Long Long : minList) { |
| | | Integer cc = map.get(Long); |
| | | if (cc != null) { |
| | | map.put(Long, ++cc); |
| | | continue; |
| | | } |
| | | map.put(Long, 1); |
| | | } |
| | | |
| | | for (Map.Entry<Long, Integer> entry : map.entrySet()) { |
| | | if (entry.getValue() == 1) { |
| | | diff.add(entry.getKey()); |
| | | } |
| | | } |
| | | return diff; |
| | | } |
| | | |
| | | public static void main(Long[] args) { |
| | | // List<Long> Longs1 = Arrays.asList(1L, 2L, 2L, 3L, 4L); |
| | | // List<Long> Longs2 = Arrays.asList(1L, 2L, 5L, 6L, 4L); |
| | | // List<Long> diffrent = getDiffrent(Longs1, Longs2); |
| | | // System.out.println(diffrent); |
| | | } |
| | | } |
| | |
| | | import org.apache.http.HttpEntity; |
| | | import org.apache.http.HttpResponse; |
| | | import org.apache.http.client.HttpClient; |
| | | import org.apache.http.client.methods.HttpGet; |
| | | import org.apache.http.client.methods.HttpPost; |
| | | import org.apache.http.entity.StringEntity; |
| | | import org.apache.http.impl.client.DefaultHttpClient; |
| | | import org.apache.http.message.BasicHeader; |
| | | import org.apache.http.util.EntityUtils; |
| | | import org.springframework.util.ObjectUtils; |
| | | |
| | | import java.io.BufferedReader; |
| | | import java.io.IOException; |
| | | import java.io.InputStreamReader; |
| | | import java.io.OutputStreamWriter; |
| | | import java.net.MalformedURLException; |
| | | import java.net.URL; |
| | | import java.net.URLConnection; |
| | | import java.util.Iterator; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @program: springcloud_k8s_panzhihuazhihuishequ |
| | |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 使用http请求调用接口,参数类型为xml |
| | | * @param urlStr 请求地址 |
| | | * @param data 请求参数 |
| | | * @return 调用结果 |
| | | */ |
| | | public static String httpsRequest(String urlStr,String data) { |
| | | try { |
| | | URL url = new URL(urlStr); |
| | | URLConnection con = url.openConnection(); |
| | | con.setDoOutput(true); |
| | | // con.setRequestProperty("Pragma:", "no-cache"); |
| | | con.setRequestProperty("Cache-Control", "no-cache"); |
| | | con.setRequestProperty("Content-Type", "text/xml"); |
| | | |
| | | OutputStreamWriter out = new OutputStreamWriter(con |
| | | .getOutputStream()); |
| | | log.info("urlStr=" + urlStr); |
| | | log.info("xmlInfo=" + data); |
| | | out.write(new String(data.getBytes("UTF-8"))); |
| | | out.flush(); |
| | | out.close(); |
| | | BufferedReader br = new BufferedReader(new InputStreamReader(con |
| | | .getInputStream())); |
| | | String line = ""; |
| | | StringBuffer sb = new StringBuffer(); |
| | | for (line = br.readLine(); line != null; line = br.readLine()) { |
| | | sb.append(line); |
| | | } |
| | | return sb.toString(); |
| | | } catch (MalformedURLException e) { |
| | | e.printStackTrace(); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return ""; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * http请求工具类,get请求 |
| | | * |
| | | * @param url |
| | | * @param params |
| | | * @param resonseCharSet |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | public static String httpGet(String url, Map<String, Object> params, String... resonseCharSet) throws Exception { |
| | | DefaultHttpClient defaultHttpClient = null; |
| | | BufferedReader bufferedReader = null; |
| | | try { |
| | | defaultHttpClient = new DefaultHttpClient(); |
| | | if (params != null) { |
| | | StringBuilder stringBuilder = new StringBuilder(); |
| | | Iterator<String> iterator = params.keySet().iterator(); |
| | | String key; |
| | | while (iterator.hasNext()) { |
| | | key = iterator.next(); |
| | | Object val = params.get(key); |
| | | if (val instanceof List) { |
| | | List v = (List) val; |
| | | for (Object o : v) { |
| | | stringBuilder.append(key).append("=").append(o.toString()).append("&"); |
| | | } |
| | | } else { |
| | | stringBuilder.append(key).append("=").append(val.toString()).append("&"); |
| | | } |
| | | } |
| | | stringBuilder.deleteCharAt(stringBuilder.length() - 1); |
| | | url = url + "?" + stringBuilder.toString(); |
| | | log.info("url:{}", url); |
| | | } |
| | | HttpGet httpGet = new HttpGet(url); |
| | | httpGet.setHeader("Content-Type", "application/json;charset=ut-8"); |
| | | HttpResponse httpResponse = defaultHttpClient.execute(httpGet); |
| | | if (httpResponse.getStatusLine().getStatusCode() != 200) { |
| | | String errorLog = "请求失败,errorCode:" + httpResponse.getStatusLine().getStatusCode(); |
| | | log.info(errorLog); |
| | | throw new Exception(url + errorLog); |
| | | } |
| | | //读取返回信息 |
| | | String charSet = "utf-8"; |
| | | if (resonseCharSet != null && resonseCharSet.length > 0) |
| | | charSet = resonseCharSet[0]; |
| | | String output; |
| | | bufferedReader = new BufferedReader(new InputStreamReader(httpResponse.getEntity().getContent(), charSet)); |
| | | |
| | | StringBuilder dataBuilder = new StringBuilder(); |
| | | while ((output = bufferedReader.readLine()) != null) { |
| | | dataBuilder.append(output); |
| | | } |
| | | return dataBuilder.toString(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | throw e; |
| | | } finally { |
| | | if (defaultHttpClient != null) |
| | | defaultHttpClient.getConnectionManager().shutdown(); |
| | | if (bufferedReader != null) |
| | | bufferedReader.close(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * http请求工具类,post请求 |
| | | * |
| | | * @param url url |
| | | * @param param 参数值 仅支持String |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | public static String httpPost(String url, String param) throws Exception { |
| | | DefaultHttpClient defaultHttpClient = null; |
| | | BufferedReader bufferedReader = null; |
| | | try { |
| | | defaultHttpClient = new DefaultHttpClient(); |
| | | HttpPost httpPost = new HttpPost(url); |
| | | httpPost.setHeader("Content-Type", "application/json;charset=ut-8"); |
| | | if (StringUtils.isNotBlank(param)) { |
| | | log.info("参数值:{}", param); |
| | | HttpEntity httpEntity = new StringEntity(param, "utf-8"); |
| | | httpPost.setEntity(httpEntity); |
| | | } |
| | | HttpResponse httpResponse = defaultHttpClient.execute(httpPost); |
| | | if (httpResponse.getStatusLine().getStatusCode() != 200) { |
| | | String errorLog = "请求失败,errorCode:" + httpResponse.getStatusLine().getStatusCode(); |
| | | log.info(errorLog); |
| | | throw new Exception(url + errorLog); |
| | | } |
| | | //读取返回信息 |
| | | String output; |
| | | bufferedReader = new BufferedReader(new InputStreamReader(httpResponse.getEntity().getContent(), "utf-8")); |
| | | StringBuilder stringBuilder = new StringBuilder(); |
| | | while ((output = bufferedReader.readLine()) != null) { |
| | | stringBuilder.append(output); |
| | | } |
| | | log.info("调用微信接口返回的参数:" + stringBuilder.toString()); |
| | | return stringBuilder.toString(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | throw e; |
| | | } finally { |
| | | if (defaultHttpClient != null) |
| | | defaultHttpClient.getConnectionManager().shutdown(); |
| | | if (bufferedReader != null) |
| | | bufferedReader.close(); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | ipAddress = "["+jsonObject.get("country")+"/" +jsonObject.get("city")+"]"; |
| | | } |
| | | }catch(Exception e){ |
| | | |
| | | log.error("获取IP所属地址出错",e); |
| | | e.printStackTrace(); |
| | | log.error("获取IP所属地址出错"); |
| | | //e.printStackTrace(); |
| | | } |
| | | return ipAddress; |
| | | } |
| | |
| | | return getVerifyCode(idNumber).equalsIgnoreCase(idNumber.substring(17)); |
| | | } |
| | | |
| | | public static void main(String[] args) { |
| | | String cardNo = "510403201602230324"; |
| | | Boolean isok = strongVerifyIdNumber(cardNo); |
| | | System.out.println(); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.utlis; |
| | | |
| | | import java.text.DateFormat; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | |
| | | public class OrderNoUtils { |
| | | private static int sn = 0; |
| | | |
| | | public static String NextOrderNo(Long userId) { |
| | | if (sn == 999) |
| | | sn = 0; |
| | | else |
| | | sn++; |
| | | DateFormat df = new SimpleDateFormat("MMddHHmmss"); |
| | | return df.format(new Date()) + padRight(String.valueOf(userId), 5, '0') + padRight(String.valueOf(sn), 3, '0') + getRandomNumber(); |
| | | } |
| | | |
| | | public static String padLeft(String src, int len, char ch) { |
| | | int diff = len - src.length(); |
| | | if (diff <= 0) { |
| | | return src; |
| | | } |
| | | |
| | | char[] charr = new char[len]; |
| | | System.arraycopy(src.toCharArray(), 0, charr, 0, src.length()); |
| | | for (int i = src.length(); i < len; i++) { |
| | | charr[i] = ch; |
| | | } |
| | | return new String(charr); |
| | | } |
| | | |
| | | public static String padRight(String src, int len, char ch) { |
| | | int diff = len - src.length(); |
| | | if (diff <= 0) { |
| | | return src; |
| | | } |
| | | |
| | | char[] charr = new char[len]; |
| | | System.arraycopy(src.toCharArray(), 0, charr, diff, src.length()); |
| | | for (int i = 0; i < diff; i++) { |
| | | charr[i] = ch; |
| | | } |
| | | return new String(charr); |
| | | } |
| | | |
| | | // 防止创建类的实例 |
| | | private OrderNoUtils() { |
| | | } |
| | | |
| | | /** |
| | | * 获取三位随机数 |
| | | * @return 三位随机数 |
| | | */ |
| | | private static String getRandomNumber(){ |
| | | return String.valueOf(new Double((Math.random() * 9 + 1) * (Math.pow(10, 3 - 1))).intValue()); |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.utlis; |
| | | |
| | | import org.jdom2.input.SAXBuilder; |
| | | |
| | | import java.io.ByteArrayInputStream; |
| | | import java.io.InputStream; |
| | | import java.math.BigDecimal; |
| | | import java.net.InetAddress; |
| | | import java.net.UnknownHostException; |
| | | import java.security.MessageDigest; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | |
| | | public class PayUtil { |
| | | |
| | | /** |
| | | * 获取当前机器的ip |
| | | */ |
| | | public static String getLocalIp() { |
| | | InetAddress ia = null; |
| | | String localip = null; |
| | | try { |
| | | ia = ia.getLocalHost(); |
| | | localip = ia.getHostAddress(); |
| | | } catch (UnknownHostException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return localip; |
| | | } |
| | | @SuppressWarnings("rawtypes") |
| | | public static String getRequestXml(SortedMap<Object, Object> parameters) { |
| | | StringBuffer sb = new StringBuffer(); |
| | | sb.append("<xml>"); |
| | | Set es = parameters.entrySet(); |
| | | Iterator it = es.iterator(); |
| | | while (it.hasNext()) { |
| | | Map.Entry entry = (Map.Entry) it.next(); |
| | | String k = (String) entry.getKey(); |
| | | String v = (String) entry.getValue(); |
| | | if ("attach".equalsIgnoreCase(k) || "body".equalsIgnoreCase(k) || "sign".equalsIgnoreCase(k)) { |
| | | sb.append("<" + k + ">" + "<![CDATA[" + v + "]]></" + k + ">"); |
| | | } else { |
| | | sb.append("<" + k + ">" + v + "</" + k + ">"); |
| | | } |
| | | } |
| | | sb.append("</xml>"); |
| | | return sb.toString(); |
| | | } |
| | | /** |
| | | * 创建签名Sign |
| | | */ |
| | | @SuppressWarnings("rawtypes") |
| | | public static String createSign(String characterEncoding,SortedMap<Object, Object> parameters, String key) { |
| | | StringBuffer sb = new StringBuffer(); |
| | | Set es = parameters.entrySet(); |
| | | Iterator<?> it = es.iterator(); |
| | | while (it.hasNext()) { |
| | | Map.Entry entry = (Map.Entry) it.next(); |
| | | String k = (String) entry.getKey(); |
| | | if (entry.getValue() != null || !"".equals(entry.getValue())) { |
| | | String v = String.valueOf(entry.getValue()); |
| | | if (null != v && !"".equals(v) && !"sign".equals(k) && !"key".equals(k)) { |
| | | sb.append(k + "=" + v + "&"); |
| | | } |
| | | } |
| | | } |
| | | sb.append("key=" + key); |
| | | String sign = ""; |
| | | try { |
| | | sign = MD5(sb.toString()); |
| | | }catch (Exception e){ |
| | | return e.getMessage(); |
| | | } |
| | | return sign; |
| | | } |
| | | /** |
| | | * 生成随机数 |
| | | */ |
| | | public static String makeUUID(int len) { |
| | | return UUID.randomUUID().toString().replaceAll("-", "").substring(0, len); |
| | | } |
| | | /** |
| | | * 生成订单号 |
| | | */ |
| | | public static String generateOrderNo() { |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyMMdd"); |
| | | return sdf.format(new Date()) + makeUUID(16); |
| | | } |
| | | /** |
| | | * 解析xml |
| | | */ |
| | | public static Map doXMLParse(String strxml) throws Exception { |
| | | strxml = strxml.replaceFirst("encoding=\".*\"", "encoding=\"UTF-8\""); |
| | | if (StringUtils.isNotEmpty(strxml)) { |
| | | return null; |
| | | } |
| | | Map m = new HashMap(); |
| | | InputStream in = new ByteArrayInputStream(strxml.getBytes("UTF-8")); |
| | | SAXBuilder builder = new SAXBuilder(); |
| | | org.jdom2.Document doc = builder.build(in); |
| | | org.jdom2.Element root = doc.getRootElement(); |
| | | List list = root.getChildren(); |
| | | Iterator it = list.iterator(); |
| | | while (it.hasNext()) { |
| | | org.jdom2.Element e = (org.jdom2.Element) it.next(); |
| | | String k = e.getName(); |
| | | String v = ""; |
| | | List children = e.getChildren(); |
| | | if (children.isEmpty()) { |
| | | v = e.getTextNormalize(); |
| | | } else { |
| | | v = getChildrenText(children); |
| | | } |
| | | m.put(k, v); |
| | | } |
| | | //关闭流 |
| | | in.close(); |
| | | return m; |
| | | } |
| | | /** |
| | | * 获取子节点的xml |
| | | */ |
| | | public static String getChildrenText(List children) { |
| | | StringBuffer sb = new StringBuffer(); |
| | | if (!children.isEmpty()) { |
| | | Iterator it = children.iterator(); |
| | | while (it.hasNext()) { |
| | | org.jdom2.Element e = (org.jdom2.Element) it.next(); |
| | | String name = e.getName(); |
| | | String value = e.getTextNormalize(); |
| | | List list = e.getChildren(); |
| | | sb.append("<" + name + ">"); |
| | | if (!list.isEmpty()) { |
| | | sb.append(getChildrenText(list)); |
| | | } |
| | | sb.append(value); |
| | | sb.append("</" + name + ">"); |
| | | } |
| | | } |
| | | return sb.toString(); |
| | | } |
| | | /** |
| | | * 转换金额到整型 |
| | | */ |
| | | public static String moneyToIntegerStr(BigDecimal money) { |
| | | int amount = money.multiply(new BigDecimal((100))) |
| | | .setScale(0, BigDecimal.ROUND_HALF_UP).intValue(); |
| | | return String.valueOf(amount); |
| | | } |
| | | /** |
| | | * 微信下单,map to xml |
| | | * @param params 参数 |
| | | * @return String |
| | | */ |
| | | public static String mapToXml(Map<String, String> params) { |
| | | StringBuilder xml = new StringBuilder(); |
| | | xml.append("<xml>"); |
| | | for (Map.Entry<String, String> entry : params.entrySet()) { |
| | | String key = entry.getKey(); |
| | | String value = entry.getValue(); |
| | | // 略过空值 |
| | | if (StringUtils.isEmpty(value)) continue; |
| | | xml.append("<").append(key).append("><![CDATA["); |
| | | xml.append(entry.getValue()); |
| | | xml.append("]]></").append(key).append(">"); |
| | | } |
| | | xml.append("</xml>"); |
| | | return xml.toString(); |
| | | } |
| | | |
| | | /** |
| | | * 生成 MD5 |
| | | * |
| | | * @param data 待处理数据 |
| | | * @return MD5结果 |
| | | */ |
| | | public static String MD5(String data) throws Exception { |
| | | java.security.MessageDigest md = MessageDigest.getInstance("MD5"); |
| | | byte[] array = md.digest(data.getBytes("UTF-8")); |
| | | StringBuilder sb = new StringBuilder(); |
| | | for (byte item : array) { |
| | | sb.append(Integer.toHexString((item & 0xFF) | 0x100).substring(1, 3)); |
| | | } |
| | | return sb.toString().toUpperCase(); |
| | | } |
| | | |
| | | |
| | | public static String create_timestamp() { |
| | | return Long.toString(System.currentTimeMillis() / 1000); |
| | | } |
| | | } |
| | |
| | | package com.panzhihua.common.utlis; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | import java.util.Base64; |
| | | |
| | |
| | | * @author: huang.hongfa weixin hhf9596 qq 959656820 |
| | | * @create: 2021-01-08 09:45 |
| | | **/ |
| | | @Slf4j |
| | | public class RealNameUtil { |
| | | private static final String CLIENT_ID="2092261934651932672"; |
| | | private static final String SECRET="de1c0dbb-9197-4724-9cc2-aa94e30a072f"; |
| | |
| | | jsonObject.put("idNumber",idcard); |
| | | jsonObject.put("realName",name); |
| | | String param=jsonObject.toJSONString(); |
| | | String postByJson = HttpClientUtil.sendPostByJson(URL, param, 0, headerkey, headervalue + encodeToString); |
| | | log.info("请求公安实名认证接口,请求地址:" + URL); |
| | | log.info("请求公安实名认证接口,请求参数:" + param); |
| | | log.info("请求公安实名认证接口,请求头参数:" + headervalue + encodeToString); |
| | | String postByJson = HttpClientUtil.sendPostByJson(URL, param, 0, headerkey, "Basic MjA5MjI2MTkzNDY1MTkzMjY3MjpkZTFjMGRiYi05MTk3LTQ3MjQtOWNjMi1hYTk0ZTMwYTA3MmY6MTYxOTQyMTMyMzgxMg=="); |
| | | log.info("请求公安实名认证接口,返回参数:" + postByJson); |
| | | int code = JSONObject.parseObject(postByJson).getIntValue("code"); |
| | | if (0==code) { |
| | | result =true; |
| | |
| | | } |
| | | |
| | | public static void main(String[] args) { |
| | | boolean b = RealNameUtil.authentication("340823199112282557", "黄宏发f"); |
| | | boolean b = RealNameUtil.authentication("340823199112282557", "黄宏发"); |
| | | System.out.println(b); |
| | | } |
| | | |
New file |
| | |
| | | package com.panzhihua.common.utlis; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.panzhihua.common.constants.PayCpmstant; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.json.XML; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Map; |
| | | import java.util.SortedMap; |
| | | import java.util.TreeMap; |
| | | |
| | | @Slf4j |
| | | public class WxPayUtils { |
| | | |
| | | public static String getUnifiedorder(String appid, String mchId, String payKey, String notifyUrl, String body, String openid, String outTradeNo, BigDecimal money){ |
| | | String nonceStr = PayUtil.makeUUID(32); |
| | | SortedMap<Object, Object> params = new TreeMap<>(); |
| | | params.put("appid", appid); |
| | | params.put("body", body); |
| | | params.put("mch_id", mchId); |
| | | params.put("nonce_str",nonceStr); |
| | | params.put("notify_url", notifyUrl); |
| | | params.put("openid", openid); |
| | | params.put("out_trade_no", outTradeNo);//商品订单号 |
| | | params.put("spbill_create_ip", PayUtil.getLocalIp());//服务部署的ip |
| | | params.put("total_fee", PayUtil.moneyToIntegerStr(money));//费用的参数转型 |
| | | params.put("trade_type", "JSAPI");//对接类型 |
| | | params.put("sign", PayUtil.createSign(PayCpmstant.DEFAULT_ENCODING, params, payKey));//MD5签名 |
| | | //转换成xml |
| | | String xmlData = PayUtil.getRequestXml(params); |
| | | //请求微信后台,获取支付id |
| | | String resXml = HttpClientUtil.httpsRequest(PayCpmstant.UNIFIEDORDER_URL, xmlData); |
| | | log.info("请求微信支付返回参数:" + resXml); |
| | | |
| | | org.json.JSONObject resultData = XML.toJSONObject(resXml); |
| | | JSONObject data = JSON.parseObject(resultData.get("xml").toString()); |
| | | JSONObject result = new JSONObject(); |
| | | if(data.get("return_msg").equals(PayCpmstant.RETURN_MSG) && data.get("return_code").equals(PayCpmstant.RETURN_CODE)){ |
| | | //将微信统一下单成功的参数拼接再签名 |
| | | //统一下单返回prepay_id |
| | | String prepayId = "prepay_id=" + data.getString("prepay_id"); |
| | | //时间戳 |
| | | Long timeStamp = System.currentTimeMillis()/1000; |
| | | //封装需要签名的字段 |
| | | SortedMap<Object, Object> payParams = new TreeMap<>(); |
| | | payParams.put("appId", appid); |
| | | payParams.put("nonceStr",nonceStr); |
| | | payParams.put("package",prepayId); |
| | | payParams.put("signType",PayCpmstant.SIGN_TYPE); |
| | | payParams.put("timeStamp",timeStamp); |
| | | //将参数以及签名计算完成封装返回给前端 |
| | | result.put("timeStamp",timeStamp); |
| | | result.put("nonceStr",nonceStr); |
| | | result.put("package",prepayId); |
| | | result.put("signType",PayCpmstant.SIGN_TYPE); |
| | | result.put("paySign",PayUtil.createSign(PayCpmstant.DEFAULT_ENCODING, payParams, payKey)); |
| | | } |
| | | return result.toJSONString(); |
| | | } |
| | | |
| | | public static SortedMap<Object, Object> prepayId(Map<String, String> map) { |
| | | SortedMap<Object, Object> parameters = new TreeMap<>(); |
| | | parameters.put("appId", ""); |
| | | parameters.put("timeStamp", PayUtil.create_timestamp()); |
| | | parameters.put("nonceStr", map.get("nonce_str")); |
| | | parameters.put("package", "prepay_id=" + map.get("prepay_id")); |
| | | parameters.put("signType", "MD5"); |
| | | String sign = PayUtil.createSign("UTF-8", parameters, "商户秘钥"); |
| | | parameters.put("prepay_id", "prepay_id=" + map.get("prepay_id")); |
| | | parameters.put("paySign", sign); |
| | | return parameters; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.utlis; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import org.apache.commons.fileupload.FileItem; |
| | | import org.apache.commons.fileupload.FileItemFactory; |
| | | import org.apache.commons.fileupload.disk.DiskFileItemFactory; |
| | | import org.apache.http.entity.ContentType; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | import org.springframework.web.multipart.commons.CommonsMultipartFile; |
| | | |
| | | import java.io.*; |
| | | import java.net.HttpURLConnection; |
| | | import java.net.URL; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | public class WxUtil { |
| | | |
| | | //客服消息推送地址 |
| | | public final static String kf_url = "https://api.weixin.qq.com/cgi-bin/message/custom/send"; |
| | | |
| | | public static String sendKfLinkMessage(String openid,String url,String thumbUrl,String access_token)throws Exception{ |
| | | Map<String,Object> map_content = new HashMap<>(); |
| | | map_content.put("title","社区福利一分购"); |
| | | map_content.put("description","点击参与社区一分钱抢购活动"); |
| | | map_content.put("url",url);//跳转地址 |
| | | map_content.put("thumb_url",thumbUrl);//图片地址 |
| | | Map<String,Object> map = new HashMap<>(); |
| | | map.put("touser",openid); |
| | | map.put("msgtype","link"); |
| | | map.put("link",map_content); |
| | | String content = JSON.toJSONString(map); |
| | | return HttpClientUtil.httpPost(kf_url+"?access_token="+access_token,content); |
| | | } |
| | | |
| | | public static String sendKfConetntMessage(String openid,String access_token)throws Exception{ |
| | | Map<String,Object> map_content = new HashMap<>(); |
| | | map_content.put("content","社区福利一分购"); |
| | | Map<String,Object> map = new HashMap<>(); |
| | | map.put("touser",openid); |
| | | map.put("msgtype","text"); |
| | | map.put("text",map_content); |
| | | String content = JSON.toJSONString(map); |
| | | return HttpClientUtil.httpPost(kf_url+"?access_token="+access_token,content); |
| | | } |
| | | |
| | | public static String sendKfImagesMessage(String openid,String access_token,String mediaId)throws Exception{ |
| | | Map<String,Object> map_content = new HashMap<>(); |
| | | map_content.put("media_id",mediaId); |
| | | Map<String,Object> map = new HashMap<>(); |
| | | map.put("touser",openid); |
| | | map.put("msgtype","image"); |
| | | map.put("image",map_content); |
| | | String content = JSON.toJSONString(map); |
| | | return HttpClientUtil.httpPost(kf_url+"?access_token="+access_token,content); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.utlis; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.panzhihua.common.constants.SecurityConstants; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.fileupload.FileItem; |
| | | import org.apache.commons.fileupload.FileItemFactory; |
| | | import org.apache.commons.fileupload.disk.DiskFileItemFactory; |
| | | import org.apache.http.entity.ContentType; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.redis.core.StringRedisTemplate; |
| | | import org.springframework.data.redis.core.ValueOperations; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | import org.springframework.web.multipart.commons.CommonsMultipartFile; |
| | | |
| | | import java.io.*; |
| | | import java.net.HttpURLConnection; |
| | | import java.net.URL; |
| | | import java.util.Map; |
| | | import java.util.concurrent.TimeUnit; |
| | | |
| | | @Slf4j |
| | | @Component |
| | | public class WxXCXTempSend { |
| | | |
| | | private static String ACCESS_TOKEN_URL = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential"; |
| | | private static String APP_IMAGE_URL = "https://www.psciio.com//idcard/8fa82cfba258498eab2fa818220fb592.jpg"; |
| | | private static String APP_IMAGE_NAME = "5.jpg"; |
| | | |
| | | public static final String APP_ID = "wx0cef797390444b75"; |
| | | private static final String APP_SECRET = "c7ea9aaa7e391a487e8a5b9ba61045d1"; |
| | | |
| | | @Autowired |
| | | private StringRedisTemplate redisTemplate; |
| | | |
| | | /** |
| | | * 获取小程序token,(ps:0=token获取失败) |
| | | * |
| | | * @return |
| | | */ |
| | | public String getAccessToken() throws Exception { |
| | | // String accessToken = ; |
| | | // Boolean aBoolean = redisTemplate.hasKey(SecurityConstants.APPLETS_ACCESS_TOKEN); |
| | | // ValueOperations<String, String> valueOperations = redisTemplate.opsForValue(); |
| | | // if(aBoolean){ |
| | | // Long expireTime = Long.parseLong(valueOperations.get(SecurityConstants.APPLETS_ACCESS_TOKEN_TIME)); |
| | | // if(expireTime <= System.currentTimeMillis()){ |
| | | // redisTemplate.delete(SecurityConstants.APPLETS_ACCESS_TOKEN);//如果过期则删除 |
| | | // redisTemplate.delete(SecurityConstants.APPLETS_ACCESS_TOKEN_TIME);//如果过期则删除 |
| | | // |
| | | // valueOperations.set(SecurityConstants.APPLETS_ACCESS_TOKEN, accessToken); |
| | | // valueOperations.set(SecurityConstants.APPLETS_ACCESS_TOKEN_TIME, System.currentTimeMillis() + 1100000 + ""); |
| | | // }else{ |
| | | // accessToken = valueOperations.get(SecurityConstants.APPLETS_ACCESS_TOKEN); |
| | | // } |
| | | // }else{ |
| | | // accessToken = getAppAccessToken(); |
| | | // valueOperations.set(SecurityConstants.APPLETS_ACCESS_TOKEN, accessToken); |
| | | // valueOperations.set(SecurityConstants.APPLETS_ACCESS_TOKEN_TIME, System.currentTimeMillis() + 1100000 + ""); |
| | | // } |
| | | return getAppAccessToken(); |
| | | } |
| | | |
| | | private String getAppAccessToken() throws Exception{ |
| | | String accessToken = "0"; |
| | | try { |
| | | //此处APP_ID APP_SECRET 在微信小程序后端可见 |
| | | // String accessTokenUrl = String.format(TEMP_URL, APP_ID, APP_SECRET); |
| | | String accessTokenUrl = ACCESS_TOKEN_URL + "&appid=" + APP_ID + "&secret=" + APP_SECRET; |
| | | String result = HttpClientUtil.httpGet(accessTokenUrl, null, null); |
| | | Map<String, Object> resultMap = JSON.parseObject(result, Map.class); |
| | | if(resultMap.containsKey("access_token")) { |
| | | accessToken = resultMap.get("access_token").toString(); |
| | | } |
| | | } catch (IOException ioe) { |
| | | log.error("小程序http请求异常"); |
| | | ioe.printStackTrace(); |
| | | } |
| | | return accessToken; |
| | | } |
| | | |
| | | public String getMediaId(String accessToken){ |
| | | String mediaId = ""; |
| | | Boolean aBoolean = redisTemplate.hasKey(SecurityConstants.APPLETS_ACCESS_MEDIA_ID); |
| | | ValueOperations<String, String> valueOperations = redisTemplate.opsForValue(); |
| | | if(aBoolean){ |
| | | Long expireTime = Long.parseLong(valueOperations.get(SecurityConstants.APPLETS_ACCESS_MEDIA_ID_TIME)); |
| | | if(expireTime <= System.currentTimeMillis()){ |
| | | redisTemplate.delete(SecurityConstants.APPLETS_ACCESS_MEDIA_ID);//如果过期则删除 |
| | | redisTemplate.delete(SecurityConstants.APPLETS_ACCESS_MEDIA_ID_TIME);//如果过期则删除 |
| | | mediaId = getAppMediaId(accessToken); |
| | | valueOperations.set(SecurityConstants.APPLETS_ACCESS_MEDIA_ID, mediaId); |
| | | valueOperations.set(SecurityConstants.APPLETS_ACCESS_MEDIA_ID_TIME, System.currentTimeMillis() + 259000000 + ""); |
| | | }else{ |
| | | mediaId = valueOperations.get(SecurityConstants.APPLETS_ACCESS_MEDIA_ID); |
| | | } |
| | | }else{ |
| | | mediaId = getAppMediaId(accessToken); |
| | | valueOperations.set(SecurityConstants.APPLETS_ACCESS_MEDIA_ID, mediaId); |
| | | valueOperations.set(SecurityConstants.APPLETS_ACCESS_MEDIA_ID_TIME, System.currentTimeMillis() + 259000000 + ""); |
| | | } |
| | | return mediaId; |
| | | } |
| | | |
| | | private String getAppMediaId(String accessToken){ |
| | | String appMediaId = ""; |
| | | try { |
| | | MultipartFile file = createFileItem(APP_IMAGE_URL,APP_IMAGE_NAME); |
| | | appMediaId = uploadFile(file,accessToken); |
| | | }catch (Exception e){ |
| | | log.error("上传临时图片素材失败,错误原因:" + e.getMessage()); |
| | | } |
| | | return appMediaId; |
| | | } |
| | | |
| | | /** |
| | | * url转变为 MultipartFile对象 |
| | | * @param url |
| | | * @param fileName |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | private static MultipartFile createFileItem(String url, String fileName) throws Exception{ |
| | | FileItem item = null; |
| | | try { |
| | | HttpURLConnection conn = (HttpURLConnection) new URL(url).openConnection(); |
| | | conn.setReadTimeout(30000); |
| | | conn.setConnectTimeout(30000); |
| | | //设置应用程序要从网络连接读取数据 |
| | | conn.setDoInput(true); |
| | | conn.setRequestMethod("GET"); |
| | | if (conn.getResponseCode() == HttpURLConnection.HTTP_OK) { |
| | | InputStream is = conn.getInputStream(); |
| | | |
| | | FileItemFactory factory = new DiskFileItemFactory(16, null); |
| | | String textFieldName = "uploadfile"; |
| | | item = factory.createItem(textFieldName, ContentType.APPLICATION_OCTET_STREAM.toString(), false, fileName); |
| | | OutputStream os = item.getOutputStream(); |
| | | |
| | | int bytesRead = 0; |
| | | byte[] buffer = new byte[8192]; |
| | | while ((bytesRead = is.read(buffer, 0, 8192)) != -1) { |
| | | os.write(buffer, 0, bytesRead); |
| | | } |
| | | os.close(); |
| | | is.close(); |
| | | } |
| | | } catch (IOException e) { |
| | | throw new RuntimeException("文件下载失败", e); |
| | | } |
| | | |
| | | return new CommonsMultipartFile(item); |
| | | } |
| | | |
| | | /** |
| | | * 微信小程序临时素材上传 |
| | | * |
| | | * @param file |
| | | * @return |
| | | * @author yixiu |
| | | * @throws Exception |
| | | */ |
| | | public String uploadFile(MultipartFile file,String access_token) throws Exception { |
| | | String url = "https://api.weixin.qq.com/cgi-bin/media/upload?access_token=" + access_token + "&type=image"; |
| | | String result = null; |
| | | String fileName = file.getOriginalFilename(); |
| | | URL urlObj = new URL(url); |
| | | HttpURLConnection con = (HttpURLConnection) urlObj.openConnection(); |
| | | con.setRequestMethod("POST"); |
| | | con.setDoInput(true); |
| | | con.setDoOutput(true); |
| | | con.setUseCaches(false); |
| | | // 设置请求头信息 |
| | | con.setRequestProperty("Connection", "Keep-Alive"); |
| | | con.setRequestProperty("Charset", "UTF-8"); |
| | | // 设置边界 |
| | | String BOUNDARY = "----------" + System.currentTimeMillis(); |
| | | con.setRequestProperty("Content-Type", "multipart/form-data; boundary=" + BOUNDARY); |
| | | // 请求正文信息 |
| | | // 第一部分: |
| | | StringBuilder sb = new StringBuilder(); |
| | | sb.append("--"); // 必须多两道线 |
| | | sb.append(BOUNDARY); |
| | | sb.append("\r\n"); |
| | | sb.append("Content-Disposition: form-data;name=\"media\";filename=\"" + fileName + "\"\r\n"); |
| | | sb.append("Content-Type:application/octet-stream\r\n\r\n"); |
| | | byte[] head = sb.toString().getBytes("utf-8"); |
| | | // 获得输出流 |
| | | OutputStream out = new DataOutputStream(con.getOutputStream()); |
| | | // 输出表头 |
| | | out.write(head); |
| | | // 文件正文部分 |
| | | // 把文件已流文件的方式 推入到url中 |
| | | DataInputStream in = new DataInputStream(file.getInputStream()); |
| | | int bytes = 0; |
| | | byte[] bufferOut = new byte[1024]; |
| | | while ((bytes = in.read(bufferOut)) != -1) { |
| | | out.write(bufferOut, 0, bytes); |
| | | } |
| | | in.close(); |
| | | // 结尾部分 |
| | | byte[] foot = ("\r\n--" + BOUNDARY + "--\r\n").getBytes("utf-8");// 定义最后数据分隔线 |
| | | out.write(foot); |
| | | out.flush(); |
| | | out.close(); |
| | | StringBuffer buffer = new StringBuffer(); |
| | | BufferedReader reader = null; |
| | | try { |
| | | // 定义BufferedReader输入流来读取URL的响应 |
| | | reader = new BufferedReader(new InputStreamReader(con.getInputStream())); |
| | | String line = null; |
| | | while ((line = reader.readLine()) != null) { |
| | | buffer.append(line); |
| | | } |
| | | if (result == null) { |
| | | result = buffer.toString(); |
| | | } |
| | | } catch (IOException e) { |
| | | System.out.println("发送POST请求出现异常! {}"); |
| | | e.printStackTrace(); |
| | | throw new IOException("数据读取异常"); |
| | | } finally { |
| | | if (reader != null) { |
| | | reader.close(); |
| | | } |
| | | } |
| | | // 获取到返回HTTP结果 |
| | | Map<String, Object> map = JSONObject.parseObject(result, Map.class); |
| | | if (map.containsKey("media_id")) { |
| | | return map.get("media_id").toString(); |
| | | } |
| | | System.out.println("小程序上传临时素材出错,返回信息为: " + result); |
| | | return null; |
| | | } |
| | | |
| | | } |
| | |
| | | import com.panzhihua.common.model.vos.user.ComMngTagVO; |
| | | import com.panzhihua.common.model.vos.user.ComMngUserTagVO; |
| | | import com.panzhihua.common.model.vos.user.InputUserInfoVO; |
| | | import com.panzhihua.common.model.vos.user.UserElectronicFileVO; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | import com.panzhihua.common.service.user.UserService; |
| | | import com.panzhihua.common.utlis.FileUtil; |
| | |
| | | public R specialInputUser(@RequestBody PageInputUserDTO pageInputUserDTO) { |
| | | Long communityId = this.getCommunityId(); |
| | | pageInputUserDTO.setCommunityId(communityId); |
| | | return userService.specialInputUser(pageInputUserDTO); |
| | | return communityService.specialInputUser(pageInputUserDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "特殊群体/删除", response = InputUserInfoVO.class) |
| | |
| | | return userService.deleteSpecialInputUser(id); |
| | | } |
| | | |
| | | @ApiOperation(value = "特殊群体 导出特殊群体Excel") |
| | | // @ApiOperation(value = "特殊群体 导出特殊群体Excel") |
| | | // @PostMapping("/special/export") |
| | | // public R exportSpecial(@RequestBody ExportSpecialUserDTO exportSpecialUserDTO) { |
| | | // exportSpecialUserDTO.setCommunityId(this.getCommunityId()); |
| | | // String url = excelUrl; |
| | | // String uuid = UUID.randomUUID().toString().replace("-", ""); |
| | | // String name = uuid + ".xlsx"; |
| | | // String ftpUrl = "/mnt/data/web/excel/"; |
| | | //// 用户搜索了就下载搜索的用户否则下载所有用户 |
| | | // R r = userService.specialUserExport(exportSpecialUserDTO); |
| | | // if (R.isOk(r)) { |
| | | // List<EexcelUserDTO> eexcelUserDTOS = JSONArray.parseArray(JSONArray.toJSONString(r.getData()), EexcelUserDTO.class); |
| | | // try { |
| | | // SFTPUtil sftp = new SFTPUtil(userName, password, host, port); |
| | | // sftp.login(); |
| | | // boolean existDir = sftp.isExistDir(ftpUrl + name); |
| | | // if (!existDir) { |
| | | // String property = System.getProperty("user.dir"); |
| | | // String fileName = property + File.separator + name; |
| | | // // 这里 需要指定写用哪个class去写 |
| | | // ExcelWriter excelWriter = null; |
| | | // InputStream inputStream = null; |
| | | // try { |
| | | // excelWriter = EasyExcel.write(fileName, EexcelUserDTO.class).registerWriteHandler(new LongestMatchColumnWidthStyleStrategy()).registerWriteHandler(new CustomSheetWriteHandler()).build(); |
| | | // WriteSheet writeSheet = EasyExcel.writerSheet("模板").build(); |
| | | // excelWriter.write(eexcelUserDTOS, writeSheet); |
| | | // excelWriter.finish(); |
| | | // File file = new File(fileName); |
| | | // inputStream = new FileInputStream(file); |
| | | // sftp.uploadMore(ftpUrl, name, inputStream); |
| | | // sftp.logout(); |
| | | // inputStream.close(); |
| | | // String absolutePath = file.getAbsolutePath(); |
| | | // boolean delete = file.delete(); |
| | | // log.info("删除excel【{}】结果【{}】", absolutePath, delete); |
| | | // } finally { |
| | | // // 千万别忘记finish 会帮忙关闭流 |
| | | // if (inputStream != null) { |
| | | // inputStream.close(); |
| | | // } |
| | | // if (excelWriter != null) { |
| | | // excelWriter.finish(); |
| | | // } |
| | | // } |
| | | // } |
| | | // return R.ok(url + name); |
| | | // } catch (Exception e) { |
| | | // e.printStackTrace(); |
| | | // log.error("文件传输失败【{}】", e.getMessage()); |
| | | // return R.fail(); |
| | | // } |
| | | // } |
| | | // return R.fail("未查询到用户"); |
| | | // } |
| | | |
| | | @ApiOperation(value = "特殊群体-数据导出") |
| | | @PostMapping("/special/export") |
| | | public R exportSpecial(@RequestBody ExportSpecialUserDTO exportSpecialUserDTO) { |
| | | exportSpecialUserDTO.setCommunityId(this.getCommunityId()); |
| | | String url = excelUrl; |
| | | String uuid = UUID.randomUUID().toString().replace("-", ""); |
| | | String name = uuid + ".xlsx"; |
| | | public R dataExportSpecilPopulation() { |
| | | //获取登陆用户 |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); |
| | | //获取登陆用户绑定社区id |
| | | Long communityId = loginUserInfo.getCommunityId(); |
| | | //生成动态模板excel通过ftp工具上传到主节点,然后返回模板下载地址 |
| | | String ftpUrl = "/mnt/data/web/excel/"; |
| | | // 用户搜索了就下载搜索的用户否则下载所有用户 |
| | | R r = userService.specialUserExport(exportSpecialUserDTO); |
| | | if (R.isOk(r)) { |
| | | List<EexcelUserDTO> eexcelUserDTOS = JSONArray.parseArray(JSONArray.toJSONString(r.getData()), EexcelUserDTO.class); |
| | | try { |
| | | SFTPUtil sftp = new SFTPUtil(userName, password, host, port); |
| | | sftp.login(); |
| | | boolean existDir = sftp.isExistDir(ftpUrl + name); |
| | | if (!existDir) { |
| | | String property = System.getProperty("user.dir"); |
| | | String fileName = property + File.separator + name; |
| | | // 这里 需要指定写用哪个class去写 |
| | | ExcelWriter excelWriter = null; |
| | | InputStream inputStream = null; |
| | | try { |
| | | excelWriter = EasyExcel.write(fileName, EexcelUserDTO.class).registerWriteHandler(new LongestMatchColumnWidthStyleStrategy()).registerWriteHandler(new CustomSheetWriteHandler()).build(); |
| | | WriteSheet writeSheet = EasyExcel.writerSheet("模板").build(); |
| | | excelWriter.write(eexcelUserDTOS, writeSheet); |
| | | excelWriter.finish(); |
| | | File file = new File(fileName); |
| | | inputStream = new FileInputStream(file); |
| | | sftp.uploadMore(ftpUrl, name, inputStream); |
| | | sftp.logout(); |
| | | inputStream.close(); |
| | | String absolutePath = file.getAbsolutePath(); |
| | | boolean delete = file.delete(); |
| | | log.info("删除excel【{}】结果【{}】", absolutePath, delete); |
| | | } finally { |
| | | // 千万别忘记finish 会帮忙关闭流 |
| | | if (inputStream != null) { |
| | | inputStream.close(); |
| | | } |
| | | if (excelWriter != null) { |
| | | excelWriter.finish(); |
| | | String name = "特殊群体导出数据.xlsx"; |
| | | try { |
| | | SFTPUtil sftp = new SFTPUtil(userName, password, host, port); |
| | | sftp.login(); |
| | | boolean existDir = sftp.isExistDir(ftpUrl + name); |
| | | if (!existDir) { |
| | | String property = System.getProperty("user.dir"); |
| | | String fileName = property + File.separator + name; |
| | | // 这里 需要指定写用哪个class去写 |
| | | ExcelWriter excelWriter = null; |
| | | InputStream inputStream = null; |
| | | try { |
| | | List<ComMngPopulationVO> populList = JSON.parseArray(JSON.toJSONString(communityService.getPopulationListByCommunityId(communityId).getData()),ComMngPopulationVO.class); |
| | | List<ComMngPopulationExcelVo> populationExcelVoList = new ArrayList<>(); |
| | | if(populList != null && populList.size() > 0){ |
| | | for (ComMngPopulationVO popul:populList){ |
| | | if(popul.getLabel() == null){ |
| | | continue; |
| | | } |
| | | ComMngPopulationExcelVo populationExcelVo = new ComMngPopulationExcelVo(); |
| | | BeanUtils.copyProperties(popul,populationExcelVo); |
| | | //设置性别 |
| | | populationExcelVo.setSex(PopulSexEnum.getCnDescByName(popul.getSex())); |
| | | //设置政治面貌 |
| | | populationExcelVo.setPoliticalOutlook(PopulPoliticalOutlookEnum.getCnDescByName(popul.getPoliticalOutlook())); |
| | | //设置是否租住 |
| | | populationExcelVo.setIsRent(PopulIsOkEnum.getCnDescByName(popul.getIsRent())); |
| | | populationExcelVoList.add(populationExcelVo); |
| | | } |
| | | } |
| | | |
| | | excelWriter = EasyExcel.write(fileName, ComMngPopulationExcelVo.class).registerWriteHandler(new LongestMatchColumnWidthStyleStrategy()).registerWriteHandler(new CustomSheetWriteHandler()).build(); |
| | | WriteSheet writeSheet = EasyExcel.writerSheet("特殊群体导出数据").build(); |
| | | excelWriter.write(populationExcelVoList, writeSheet); |
| | | excelWriter.finish(); |
| | | File file = new File(fileName); |
| | | inputStream = new FileInputStream(file); |
| | | sftp.uploadMore(ftpUrl, name, inputStream); |
| | | sftp.logout(); |
| | | inputStream.close(); |
| | | String absolutePath = file.getAbsolutePath(); |
| | | boolean delete = file.delete(); |
| | | log.info("删除excel【{}】结果【{}】", absolutePath, delete); |
| | | } finally { |
| | | // 千万别忘记finish 会帮忙关闭流 |
| | | if (inputStream != null) { |
| | | inputStream.close(); |
| | | } |
| | | if (excelWriter != null) { |
| | | excelWriter.finish(); |
| | | } |
| | | } |
| | | return R.ok(url + name); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | log.error("文件传输失败【{}】", e.getMessage()); |
| | | return R.fail(); |
| | | } |
| | | return R.ok(excelUrl + name); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | log.error("文件传输失败【{}】", e.getMessage()); |
| | | return R.fail(); |
| | | } |
| | | return R.fail("未查询到用户"); |
| | | } |
| | | |
| | | @ApiOperation(value = "特殊群体/分页查询标签列表", response = ComMngTagVO.class) |
| | | @PostMapping("/special/tags/page") |
| | | public R specialInputUserTags(@RequestBody ComMngUserTagDTO comMngUserTagDTO) { |
| | | public R specialInputUserTags(@RequestBody PageInputUserDTO comMngUserTagDTO) { |
| | | Long communityId = this.getCommunityId(); |
| | | comMngUserTagDTO.setCommunityId(communityId); |
| | | return userService.specialInputUserTags(comMngUserTagDTO); |
| | |
| | | @ApiOperation(value = "分页查询实有人口列表", response = ComMngPopulationVO.class) |
| | | @PostMapping("/population/pagePopulation") |
| | | public R pageQueryComMngRealAssets(@RequestBody ComMngPopulationDTO comMngPopulationVO) { |
| | | //获取登陆用户绑定社区id |
| | | Long communityId = this.getLoginUserInfo().getCommunityId(); |
| | | comMngPopulationVO.setActId(communityId); |
| | | return communityService.pagePopulation(comMngPopulationVO); |
| | | } |
| | | |
| | |
| | | return R.ok(); |
| | | } |
| | | |
| | | @ApiOperation(value = "实有人口编辑") |
| | | @PostMapping(value = "/population/edit") |
| | | public R editPopulationInfo(@RequestBody EditComMngPopulationVO editComMngPopulationVO){ |
| | | LoginUserInfoVO loginUserInfo = getLoginUserInfo(); |
| | | return communityService.editPopulation(editComMngPopulationVO,loginUserInfo.getCommunityId()); |
| | | } |
| | | |
| | | @ApiOperation(value = "excel确认导入实有人口") |
| | | @PostMapping(value = "/serve/population/import/confirm", consumes = "multipart/*", headers = "content-type=multipart/form-date") |
| | | public R listSavePopulationConfirm(@RequestParam MultipartFile file, HttpServletRequest request) { |
| | | //获取文件名 |
| | | String fileName = file.getOriginalFilename(); |
| | | log.info("传入文件名字【{}】", fileName); |
| | | InputStream inputStream = null; |
| | | try { |
| | | inputStream = file.getInputStream(); |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); |
| | | ComMngPopulationConfirmServeExcelListen comMngPopulationServeExcelListen = new ComMngPopulationConfirmServeExcelListen(communityService, loginUserInfo.getCommunityId()); |
| | | EasyExcel.read(inputStream, null, comMngPopulationServeExcelListen).sheet().doRead(); |
| | | } catch (IOException e) { |
| | | log.error("导入模板失败【{}】", e.getMessage()); |
| | | e.printStackTrace(); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | @ApiOperation(value = "实有人口详情", response = ComMngPopulationVO.class) |
| | | @PostMapping("/population/detail") |
| | | public R detailPopulation(@RequestParam(value = "populationId") Long populationId) { |
| | | return communityService.detailPopulation(populationId); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询实有人口电子档案", response = UserElectronicFileVO.class) |
| | | @PostMapping("/population/electronicArchives") |
| | | public R electronicArchivesPopulation(@RequestParam(value = "populationId") Long populationId) { |
| | | return communityService.electronicArchivesPopulation(populationId); |
| | | } |
| | | |
| | | @ApiOperation(value = "实有人口标签修改", response = ComMngPopulationVO.class) |
| | | @PostMapping("/population/editTag") |
| | | public R editTagPopulation(@RequestBody ComMngPopulationTagDTO populationTagDTO) { |
| | |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "删除心愿") |
| | | @PostMapping("deletemicrowish") |
| | | public R deleteMicrowish(@RequestParam("id")Long id) { |
| | | return communityService.deletemicrowish(id); |
| | | } |
| | | |
| | | } |
| | |
| | | import com.alibaba.excel.enums.CellExtraTypeEnum; |
| | | import com.alibaba.excel.write.metadata.WriteSheet; |
| | | import com.alibaba.excel.write.style.column.LongestMatchColumnWidthStyleStrategy; |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.panzhihua.common.constants.FtpConstants; |
| | |
| | | @ApiOperation(value = "删除志愿者") |
| | | @DeleteMapping("volunteer") |
| | | public R deleteVolunteer(@RequestBody ComMngVolunteerMngVO comMngVolunteerMngVO){ |
| | | String phone1 = comMngVolunteerMngVO.getPhone(); |
| | | Object data = communityService.getVolunteerById(comMngVolunteerMngVO.getId()).getData(); |
| | | if (data==null){ |
| | | return R.fail("Id有误!"); |
| | | } |
| | | ComMngVolunteerMngAppletsVO oneVolunteerVO = JSON.parseObject(JSON.toJSONString(data), ComMngVolunteerMngAppletsVO.class); |
| | | String phone1 = oneVolunteerVO.getPhone(); |
| | | if (ObjectUtils.isEmpty(phone1)) { |
| | | return R.fail("志愿者手机号不能为空"); |
| | | } |
| | |
| | | int state = comMngVolunteerMngVO.getState().intValue(); |
| | | SysUserNoticeVO sysUserNoticeVO = new SysUserNoticeVO(); |
| | | Date date = new Date(); |
| | | sysUserNoticeVO.setUserId(comMngVolunteerMngVO1.getUserId()); |
| | | sysUserNoticeVO.setType(3); |
| | | sysUserNoticeVO.setBusinessType(5); |
| | | sysUserNoticeVO.setUserId(comMngVolunteerMngVO1.getUserId()); |
| | | sysUserNoticeVO.setUserId(comMngVolunteerMngVO1.getSubmitUserId()); |
| | | sysUserNoticeVO.setBusinessTime(date); |
| | | sysUserNoticeVO.setStatus(0); |
| | | if (state==2) {//通过 |
| | | // 修改用户志愿者审核状态 |
| | | String phone = comMngVolunteerMngVO1.getPhone(); |
| | | R r3 = userService.putUserIsVolunteer(phone,1); |
| | | //String phone = comMngVolunteerMngVO1.getPhone(); |
| | | R r3 = userService.putUserIsVolunteerById(comMngVolunteerMngVO1.getSubmitUserId(),1); |
| | | if (R.isOk(r3)) { |
| | | log.info("修改手机号【{}】的支援者状态为否",phone); |
| | | log.info("修改用户【{}】的支援者状态为否", comMngVolunteerMngVO1.getSubmitUserId()); |
| | | }else{ |
| | | log.info("手机号【{}】没有小程序用户",phone); |
| | | log.info("用户【{}】没有小程序用户", comMngVolunteerMngVO1.getSubmitUserId()); |
| | | } |
| | | |
| | | sysUserNoticeVO.setTitle("志愿者申请通过审核"); |
| | |
| | | import com.panzhihua.common.model.vos.community.questnaire.*; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | import com.panzhihua.common.service.user.UserService; |
| | | import com.panzhihua.common.utlis.ClazzUtils; |
| | | import com.panzhihua.common.utlis.SFTPUtil; |
| | | import com.panzhihua.community_backstage.config.SFTPConfig; |
| | | import com.panzhihua.community_backstage.excel.CustomSheetWriteHandler; |
| | |
| | | @ApiOperation(value = "分页查询调查问卷", response = QuestnaireListVo.class) |
| | | @PostMapping("/page") |
| | | public R page(@RequestBody PageQuestnaireDTO pageQuestnaireDTO) { |
| | | LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); |
| | | ClazzUtils.setIfStringIsEmpty(pageQuestnaireDTO); |
| | | pageQuestnaireDTO.setForMasses(null); |
| | | pageQuestnaireDTO.setForVolunteer(true); |
| | | pageQuestnaireDTO.setForParty(true); |
| | |
| | | package com.panzhihua.community_backstage.api; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.dtos.community.ComOpsHouseDTO; |
| | | import com.panzhihua.common.model.dtos.community.PageComOpsHouseDTO; |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.ComOpsHouseVO; |
| | | import com.panzhihua.common.model.vos.user.SysUserNoticeVO; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | import com.panzhihua.common.service.user.UserService; |
| | | import com.panzhihua.common.validated.AddGroup; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @program: springcloud_k8s_panzhihuazhihuishequ |
| | |
| | | public class HouseApi extends BaseController { |
| | | @Resource |
| | | private CommunityService communityService; |
| | | |
| | | @Resource |
| | | private UserService userService; |
| | | |
| | | @ApiOperation(value = "房屋租售-新增") |
| | | @PostMapping("house") |
| | |
| | | if (ObjectUtils.isEmpty(id)) { |
| | | return R.fail("房屋租售id主键不能为空"); |
| | | } |
| | | return communityService.putOpsHouse(comOpsHouseVO); |
| | | R r = communityService.putOpsHouse(comOpsHouseVO); |
| | | if(R.isOk(r) && 1==comOpsHouseVO.getStatus()) { |
| | | //审核通过添加提示信息 |
| | | SysUserNoticeVO sysUserNoticeVO = new SysUserNoticeVO(); |
| | | sysUserNoticeVO.setUserId(comOpsHouseVO.getUserId()); |
| | | sysUserNoticeVO.setType(3); |
| | | sysUserNoticeVO.setTitle("房源审核通过"); |
| | | sysUserNoticeVO.setBusinessType(10); |
| | | sysUserNoticeVO.setBusinessTitle("您提交的" + comOpsHouseVO.getTitle() +"房屋出租审核已经审核通过"); |
| | | sysUserNoticeVO.setBusinessId(comOpsHouseVO.getId()); |
| | | sysUserNoticeVO.setBusinessContent(" "); |
| | | sysUserNoticeVO.setStatus(0); |
| | | sysUserNoticeVO.setBusinessStatus(2); |
| | | R r2 = userService.addNotice(sysUserNoticeVO); |
| | | if (R.isOk(r2)) { |
| | | log.info("新增房屋出租通过审核通知成功【{}】", JSONObject.toJSONString(sysUserNoticeVO)); |
| | | } |
| | | }else if(R.isOk(r) && 2==comOpsHouseVO.getStatus()){ |
| | | //您提交的xxxx房屋出租审核已经审核通过/被驳回 |
| | | //审核驳回添加提示信息 |
| | | SysUserNoticeVO sysUserNoticeVO = new SysUserNoticeVO(); |
| | | sysUserNoticeVO.setUserId(comOpsHouseVO.getUserId()); |
| | | sysUserNoticeVO.setType(3); |
| | | sysUserNoticeVO.setTitle("房源审核被驳回"); |
| | | sysUserNoticeVO.setBusinessType(10); |
| | | sysUserNoticeVO.setBusinessTitle("您提交的" + comOpsHouseVO.getTitle() +"房屋出租审核已经被驳回"); |
| | | sysUserNoticeVO.setBusinessId(comOpsHouseVO.getId()); |
| | | sysUserNoticeVO.setStatus(0); |
| | | sysUserNoticeVO.setBusinessContent("驳回原因:" + comOpsHouseVO.getReason()); |
| | | sysUserNoticeVO.setBusinessStatus(1); |
| | | R r2 = userService.addNotice(sysUserNoticeVO); |
| | | if (R.isOk(r2)) { |
| | | log.info("新增房屋出租通过审核通知成功【{}】", JSONObject.toJSONString(sysUserNoticeVO)); |
| | | } |
| | | } |
| | | return r; |
| | | } |
| | | |
| | | @ApiOperation(value = "房屋租售-删除") |
| | |
| | | <version>${feign-httpclient.version}</version> |
| | | </dependency> |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | </dependencies> |
| | | </dependencyManagement> |
| | | |
| | |
| | | <module>community_backstage</module> |
| | | <module>service_community</module> |
| | | <module>service_user</module> |
| | | <module>shop_backstage</module> |
| | | </modules> |
| | | <packaging>pom</packaging> |
| | | |
| | |
| | | package com.panzhihua.service_community.api; |
| | | |
| | | import com.panzhihua.common.model.dtos.community.*; |
| | | import com.panzhihua.common.model.dtos.user.PageInputUserDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.*; |
| | | import com.panzhihua.common.service.user.UserService; |
| | | import com.panzhihua.service_community.service.*; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | |
| | | } |
| | | |
| | | /** |
| | | * 确认导入实有人口(有则更新,无则新建) |
| | | * @param list 用户信息 |
| | | * @param communityId 社区id |
| | | * @return 导入结果 |
| | | */ |
| | | @PostMapping("/population/import/confirm") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R listSavePopulationConfirm(@RequestBody List<ComMngPopulationServeExcelVO> list, @RequestParam(value = "communityId") Long communityId){ |
| | | return comMngPopulationService.listSavePopulationConfirm(list,communityId); |
| | | } |
| | | |
| | | /** |
| | | * 根据实有人口id查询详情 |
| | | * @param populationId 实有人口id |
| | | * @return 实有人口详情查询结果 |
| | |
| | | public R detailPopulation(@RequestParam(value = "populationId") Long populationId) { |
| | | return comMngPopulationService.detailPopulation(populationId); |
| | | } |
| | | |
| | | /** |
| | | * 查询实有人口电子档信息 |
| | | * @param populationId 实有人口id |
| | | * @return 实有人口电子档信息 |
| | | */ |
| | | @PostMapping("/population/electronicArchives") |
| | | public R electronicArchivesPopulation(@RequestParam(value = "populationId") Long populationId) { |
| | | return comMngPopulationService.electronicArchivesPopulation(populationId); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 根据实有人口id修改标签列表 |
| | |
| | | public R getPopulationLists(@RequestBody List<Long> Ids) { |
| | | return comMngPopulationService.getPopulationLists(Ids); |
| | | } |
| | | |
| | | /** |
| | | * 编辑实有人口 |
| | | * @param editComMngPopulationVO |
| | | * @return |
| | | */ |
| | | @PostMapping("/population/edit") |
| | | R editPopulation(@RequestBody EditComMngPopulationVO editComMngPopulationVO,@RequestParam("communityId") Long communityId){ |
| | | return comMngPopulationService.editPopulation(editComMngPopulationVO, communityId); |
| | | } |
| | | |
| | | /** |
| | | * 分页查询特殊群体 |
| | | * @param pageInputUserDTO 请求参数 |
| | | * @return 特殊群体列表 |
| | | */ |
| | | @PostMapping("/special/page") |
| | | public R specialInputUser(@RequestBody PageInputUserDTO pageInputUserDTO) { |
| | | return comMngPopulationService.specialInputUser(pageInputUserDTO); |
| | | } |
| | | |
| | | /** |
| | | * 删除特殊群体人员 |
| | | * @param id 特殊群体id |
| | | * @return 删除结果 |
| | | */ |
| | | @PostMapping("/special/delete") |
| | | public R deleteSpecialInputUser(@RequestParam(value = "id") Long id){ |
| | | return comMngPopulationService.deleteSpecialInputUser(id); |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | /** |
| | | * 获取志愿者详情 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @GetMapping("getVolunteerById") |
| | | R getVolunteerById(@RequestParam("id")Long id){ |
| | | return comMngVolunteerMngService.getVolunteerById(id); |
| | | } |
| | | |
| | | /** |
| | | * 删除志愿者 |
| | | * @param comMngVolunteerMngVO 手机号 |
| | | * @return 删除结果 |
| | |
| | | @PostMapping("timedtaskactactivityall") |
| | | R timedTaskActActivityAll(){ |
| | | return comActActivityService.timedTaskActActivityAll(); |
| | | } |
| | | |
| | | /** |
| | | * 定时任务刷新微心愿的状态 |
| | | * @return 更新结果 |
| | | */ |
| | | @PostMapping("timedtaskactmicrowish") |
| | | R timedTaskActMicroWishAll(){ |
| | | return comActMicroWishService.timedTaskActMicroWishAll(); |
| | | } |
| | | |
| | | /** |
| | |
| | | return comActQuestnaireService.usersAnsweQuestnaire(usersAnswerQuestnaireVO,userId); |
| | | } |
| | | |
| | | /** |
| | | * 删除微心愿 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @PostMapping("deletemicrowish") |
| | | public R deletemicrowish(@RequestParam("id") Long id){ |
| | | return comActMicroWishService.deleteMicroWish(id); |
| | | } |
| | | } |
| | |
| | | package com.panzhihua.service_community.api; |
| | | |
| | | import com.panzhihua.common.model.dtos.shop.PageComShopGoodsDTO; |
| | | import com.panzhihua.common.model.dtos.shop.*; |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.dtos.PageDTO; |
| | | import com.panzhihua.common.model.dtos.shop.PageComShopOrderSearchDTO; |
| | | import com.panzhihua.common.model.dtos.shop.PageComShopStoreDTO; |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.shop.AddShopGoodsVO; |
| | | import com.panzhihua.service_community.service.*; |
| | | import com.panzhihua.common.model.vos.shop.ShopOperLogVO; |
| | | import com.panzhihua.common.model.vos.shop.ShopStoreVO; |
| | | import com.panzhihua.service_community.service.ComShopGoodsService; |
| | | import com.panzhihua.service_community.service.ComShopOperLogService; |
| | | import com.panzhihua.service_community.service.ComShopOrderService; |
| | | import com.panzhihua.service_community.service.ComShopStoreService; |
| | | import lombok.NonNull; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import javax.validation.constraints.NotNull; |
| | | |
| | | @Slf4j |
| | |
| | | |
| | | @Resource |
| | | private ComShopStoreService comShopStoreService; |
| | | @Resource |
| | | private ComShopGoodsService comShopGoodsService; |
| | | @Resource |
| | | private ComShopOperLogService comShopOperLogService; |
| | | @Resource |
| | | private ComShopOrderService comShopOrderService; |
| | | @Resource |
| | | private ComShopCartService comShopCartService; |
| | | @Resource |
| | | private ComShopUserAddressService comShopUserAddressService; |
| | | |
| | | /** |
| | | * 店铺列表-分页查询 |
| | | * @param pageComShopStoreDTO 查询参数 |
| | | * @return ComShopStoreVO |
| | | * @return PageShopStoreVO |
| | | */ |
| | | @PostMapping("/pageShopStore") |
| | | public R pageShopStore(@RequestBody PageComShopStoreDTO pageComShopStoreDTO) { |
| | |
| | | @PostMapping("/saveStore") |
| | | public R saveStore(@RequestBody ShopStoreVO storeVO) { |
| | | return comShopStoreService.saveStore(storeVO); |
| | | } |
| | | |
| | | /** |
| | | * 新增店铺 |
| | | * @param storeVO 店铺信息 |
| | | * @return 新增结果 |
| | | */ |
| | | @PostMapping("/addStore") |
| | | public R addStore(@RequestBody ShopStoreVO storeVO) { |
| | | return comShopStoreService.addStore(storeVO); |
| | | } |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取用户商铺详细 |
| | | * |
| | | * @param userId 用户ID |
| | | * @return |
| | | */ |
| | | @GetMapping("/getUserStoreInfo") |
| | | public R getUserStoreInfo(@RequestParam("userId") Long userId) { |
| | | return comShopStoreService.getUserStoreInfo(userId); |
| | | } |
| | | /** |
| | | * 获取用户商铺详细 |
| | | * |
| | | * @param account 用户账号 |
| | | * @return |
| | | */ |
| | | @GetMapping("/getUserStoreInfoByAccount") |
| | | public R<ShopStoreVO> getUserStoreInfoByAccount(@RequestParam("account") String account) { |
| | | return comShopStoreService.getUserStoreInfo(account); |
| | | } |
| | | |
| | | /** |
| | | * 添加商城后台日志 |
| | | * |
| | | * @param shopOperlog 商城日志 |
| | | * @return 添加结果 |
| | | */ |
| | | @PostMapping("/addShopOperLog") |
| | | public R addShopOperLog(@RequestBody ShopOperLogVO shopOperlog) { |
| | | return comShopOperLogService.saveLog(shopOperlog); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 分页查询 商家后台操作日志 |
| | | * @param pageDTO 分页数据 |
| | | * @return 分页日志 |
| | | */ |
| | | @PostMapping("/pageShopOperLog") |
| | | public R pageShopOperLog(@RequestBody PageDTO pageDTO) { |
| | | return comShopOperLogService.pageShopOperLog(pageDTO); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 分页查询 商家订单 |
| | | * @param pageComShopOrderSearchDTO 分页数据 |
| | | * @return 分页订单 |
| | | */ |
| | | @PostMapping("/order/page") |
| | | public R pageShopOrder(@RequestBody PageComShopOrderSearchDTO pageComShopOrderSearchDTO) { |
| | | return comShopOrderService.pageShopOrder(pageComShopOrderSearchDTO); |
| | | } |
| | | /** |
| | | * 根据店铺id查询店铺详情 |
| | | * @param comShopStoreDTO 请求参数 |
| | | * @return 店铺详情 |
| | | */ |
| | | @PostMapping("shopStoreDetail") |
| | | public R shopStoreDetail(@RequestBody PageComShopStoreDTO comShopStoreDTO){ |
| | | return comShopStoreService.shopStoreDetail(comShopStoreDTO); |
| | | } |
| | | |
| | | /** |
| | | * 分页查询商品列表 |
| | | * @param comShopGoodsDTO 请求参数 |
| | | * @return 商品列表 |
| | | */ |
| | | @PostMapping("/pageShopGoods") |
| | | public R pageShopGoods(@RequestBody ComShopGoodsDTO comShopGoodsDTO) { |
| | | |
| | | return comShopGoodsService.pageShopGoods(comShopGoodsDTO); |
| | | } |
| | | |
| | | /** |
| | | * 根据商品id查询商品详情 |
| | | * @param goodsId 商品id |
| | | * @return 商品信息 |
| | | */ |
| | | @PostMapping("shopGoodsDetail") |
| | | public R shopGoodsDetail(@RequestParam("goodsId") Long goodsId){ |
| | | return comShopGoodsService.shopGoodsDetail(goodsId); |
| | | } |
| | | |
| | | /** |
| | | * 根据用户id查询购物车列表 |
| | | * @param userId 用户id |
| | | * @return 购物车列表信息 |
| | | */ |
| | | @PostMapping("shopCartList") |
| | | public R shopCartList(@RequestParam("userId") Long userId) { |
| | | return comShopCartService.shopCartList(userId); |
| | | } |
| | | |
| | | /** |
| | | * 查询用户购物车数量 |
| | | * @param userId 用户id |
| | | * @return 用户购物车商品数量 |
| | | */ |
| | | @PostMapping("shopCartUserTotal") |
| | | public R shopCartUserTotal(@RequestParam("userId") Long userId) { |
| | | return comShopCartService.shopCartUserTotal(userId); |
| | | } |
| | | |
| | | /** |
| | | * 购物车添加 |
| | | * @param comShopCartDTO 请求参数 |
| | | * @return 添加结果 |
| | | */ |
| | | @PostMapping("shopAddCart") |
| | | public R shopAddCart(@RequestBody ComShopCartDTO comShopCartDTO) { |
| | | return comShopCartService.shopAddCart(comShopCartDTO); |
| | | } |
| | | |
| | | /** |
| | | * 购物车内商品数量添加 |
| | | * @param shopEditNubCartDTO 请求参数 |
| | | * @return 修改结果 |
| | | */ |
| | | @PostMapping("shopEditNubCart") |
| | | public R shopEditNubCart(@RequestBody ComShopEditNubCartDTO shopEditNubCartDTO) { |
| | | return comShopCartService.shopEditNubCart(shopEditNubCartDTO); |
| | | } |
| | | |
| | | /** |
| | | * 删除购物车记录 |
| | | * @param Ids 购物车id集合 |
| | | * @return 删除结果 |
| | | */ |
| | | @PostMapping("shopDelCart") |
| | | public R shopDelCart(@RequestBody List<Long> Ids) { |
| | | return comShopCartService.shopDelCart(Ids); |
| | | } |
| | | |
| | | /** |
| | | * 查询用户收货地址列表 |
| | | * @param comShopAddressDTO 请求参数 |
| | | * @return 用户收获地址列表 |
| | | */ |
| | | @PostMapping("shopUserAddressList") |
| | | public R shopUserAddressList(@RequestBody PageComShopAddressDTO comShopAddressDTO) { |
| | | return comShopUserAddressService.shopUserAddressList(comShopAddressDTO); |
| | | } |
| | | |
| | | /** |
| | | * 用户添加书货地址 |
| | | * @param comShopAddressDTO 请求参数 |
| | | * @return 添加结果 |
| | | */ |
| | | @PostMapping("shopAddUserAddress") |
| | | public R shopAddUserAddress(@RequestBody ComShopAddressDTO comShopAddressDTO) { |
| | | return comShopUserAddressService.shopAddUserAddress(comShopAddressDTO); |
| | | } |
| | | |
| | | /** |
| | | * 用户修改收货地址 |
| | | * @param comShopAddressDTO 请求参数 |
| | | * @return 修改结果 |
| | | */ |
| | | @PostMapping("shopEditUserAddress") |
| | | public R shopEditUserAddress(@RequestBody ComShopAddressDTO comShopAddressDTO) { |
| | | return comShopUserAddressService.shopEditUserAddress(comShopAddressDTO); |
| | | } |
| | | |
| | | /** |
| | | * 用户删除收货地址 |
| | | * @param addressId 收货地址id |
| | | * @return 删除结果 |
| | | */ |
| | | @PostMapping("shopDelUserAddress") |
| | | public R shopDelUserAddress(@RequestParam("addressId") Long addressId) { |
| | | return comShopUserAddressService.shopDelUserAddress(addressId); |
| | | } |
| | | |
| | | /** |
| | | * 订单预览 |
| | | * @param orderPreviewDTO 请求参数 |
| | | * @return 订单预览数据 |
| | | */ |
| | | @PostMapping("orderPreview") |
| | | public R orderPreview(@RequestBody ComShopOrderPreviewDTO orderPreviewDTO) { |
| | | return comShopOrderService.orderPreview(orderPreviewDTO); |
| | | } |
| | | |
| | | /** |
| | | * 创建订单 |
| | | * @param orderCreateDTO 创建订单请求参数 |
| | | * @return 创建结果 |
| | | */ |
| | | @PostMapping("orderCreate") |
| | | public R orderCreate(@RequestBody ComShopOrderCreateDTO orderCreateDTO) { |
| | | return comShopOrderService.orderCreate(orderCreateDTO); |
| | | } |
| | | |
| | | /** |
| | | * 分页查询用户订单列表 |
| | | * @param comOrderListDTO 请求参数 |
| | | * @return 查询结果 |
| | | */ |
| | | @PostMapping("pageOrderList") |
| | | public R pageOrderList(@RequestBody PageComOrderListDTO comOrderListDTO){ |
| | | return comShopOrderService.pageOrderList(comOrderListDTO); |
| | | } |
| | | |
| | | /** |
| | | * 根据订单id查询订单详情 |
| | | * @param orderId 订单id |
| | | * @return 订单详情 |
| | | */ |
| | | @PostMapping("orderDetail") |
| | | public R orderDetail(@RequestParam("orderId") Long orderId) { |
| | | return comShopOrderService.orderDetail(orderId); |
| | | } |
| | | |
| | | /** |
| | | * 根据订单id取消订单 |
| | | * @param comShopOrderQueryDTO 请求参数 |
| | | * @return 取消结果 |
| | | */ |
| | | @PostMapping("orderCancel") |
| | | public R orderCancel(@RequestBody ComShopOrderQueryDTO comShopOrderQueryDTO) { |
| | | return comShopOrderService.orderCancel(comShopOrderQueryDTO); |
| | | } |
| | | |
| | | /** |
| | | * 根据订单id删除订单 |
| | | * @param orderId 订单id |
| | | * @return 删除结果 |
| | | */ |
| | | @PostMapping("orderDelete") |
| | | public R orderDelete(@RequestParam("orderId") Long orderId) { |
| | | return comShopOrderService.orderDelete(orderId); |
| | | } |
| | | |
| | | /** |
| | | * 根据订单id确认收货 |
| | | * @param comShopOrderQueryDTO 请求参数 |
| | | * @return 确认结果 |
| | | */ |
| | | @PostMapping("orderConfirm") |
| | | public R orderConfirm(@RequestBody ComShopOrderQueryDTO comShopOrderQueryDTO) { |
| | | return comShopOrderService.orderConfirm(comShopOrderQueryDTO.getOrderId(),comShopOrderQueryDTO.getPhone()); |
| | | } |
| | | |
| | | /** |
| | | * 统计用户订单数量 |
| | | * @param userId 用户id |
| | | * @return 统计结果 |
| | | */ |
| | | @PostMapping("orderStatistics") |
| | | public R orderStatistics(@RequestParam("userId") Long userId) { |
| | | return comShopOrderService.orderStatistics(userId); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 商品列表-分页查询 |
| | | * @param pageComShopGoodsDTO 查询参数 |
| | | * @return PageShopStoreVO |
| | | */ |
| | | @PostMapping("pageGoods") |
| | | public R pageShopStore(@RequestBody PageComShopGoodsDTO pageComShopGoodsDTO) { |
| | | return comShopGoodsService.pageGoodsList(pageComShopGoodsDTO); |
| | | } |
| | | |
| | | /** |
| | | * 新增商品 |
| | | * @param addShopGoodsVO |
| | | * @return |
| | | */ |
| | | @PostMapping("saveShopGoods") |
| | | public R saveStore(@RequestBody AddShopGoodsVO addShopGoodsVO) { |
| | | return comShopGoodsService.saveShopGoods(addShopGoodsVO); |
| | | } |
| | | |
| | | /** |
| | | * 编辑商品 |
| | | * @param addShopGoodsVO |
| | | * @param id 商铺Id |
| | | * @return |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @PostMapping("editShopGoods/{id}") |
| | | public R editShopGoods(@PathVariable("id") Long id,@RequestBody AddShopGoodsVO addShopGoodsVO) { |
| | | return comShopGoodsService.editShopGoods(id, addShopGoodsVO); |
| | | } |
| | | |
| | | /** |
| | | * 删除商品 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @PostMapping("deleteShopGoods") |
| | | public R deleteShopGoods(@RequestBody Long[] id) { |
| | | return comShopGoodsService.deleteShopGoods(id); |
| | | } |
| | | |
| | | /** |
| | | * 修改商品状态 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @GetMapping("changeShopGoodsStatus") |
| | | public R changeStatus(@RequestParam("id") Long id,@RequestParam("status")Integer status) { |
| | | return comShopGoodsService.changeStatus(id,status); |
| | | } |
| | | |
| | | /** |
| | | * 商家资金的订单详情 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @GetMapping("capitalDetailByStore") |
| | | public R capitalDetailByStore(@RequestParam("id") Long id) { |
| | | return comShopOrderService.capitalDetailByStore(id); |
| | | } |
| | | |
| | | /** |
| | | * 订单发货 |
| | | * @param orderShipDTO 发货信息 |
| | | * @return 发货结果 |
| | | */ |
| | | @PostMapping("/shipOrder") |
| | | R shipOrder(@RequestBody ComShopOrderShipDTO orderShipDTO){ |
| | | return comShopOrderService.shipOrder(orderShipDTO); |
| | | } |
| | | |
| | | /** |
| | | * 订单配送 |
| | | * @param deliverDTO 订单ID |
| | | * @return 配送结果 |
| | | */ |
| | | @PostMapping("/deliverOrder") |
| | | R deliverOrder(@RequestBody ComShopOrderDeliverDTO deliverDTO){ |
| | | return comShopOrderService.deliverOrder(deliverDTO); |
| | | } |
| | | /** |
| | | * 订单配送 |
| | | * @param deliverDTO 订单ID |
| | | * @return 配送完成 |
| | | */ |
| | | @PostMapping("/finishDeliverOrder") |
| | | R finishDeliverOrder(@RequestBody ComShopOrderDeliverDTO deliverDTO){ |
| | | return comShopOrderService.finishDeliverOrder(deliverDTO); |
| | | } |
| | | |
| | | /** |
| | | * 订单导出信息 |
| | | * @param comShopOrderExportDTO 订单导出信息 |
| | | * @return 订单导出信息 |
| | | */ |
| | | @PostMapping("/shopOrderExportData") |
| | | R shopOrderExportData(@RequestBody ComShopOrderExportDTO comShopOrderExportDTO){ |
| | | return comShopOrderService.shopOrderExportData(comShopOrderExportDTO); |
| | | } |
| | | |
| | | /** |
| | | * 资金管理导出信息 |
| | | * @param comShopFundsExportDTO 资金管理导出信息 |
| | | * @return 资金管理导出信息 |
| | | */ |
| | | @PostMapping("/shopOrderFundsExportData") |
| | | R shopOrderFundsExportData(@RequestBody ComShopFundsExportDTO comShopFundsExportDTO){ |
| | | return comShopOrderService.shopOrderFundsExportData(comShopFundsExportDTO); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 用户资金统计信息 |
| | | * @param userId 用户ID |
| | | * @return 统计信息 |
| | | */ |
| | | @GetMapping("/getFundsStat") |
| | | R getFundsStat(@RequestParam("userId") Long userId){ |
| | | return comShopOrderService.getFundsStat(userId); |
| | | } |
| | | |
| | | /** |
| | | * 店铺资金统计信息 |
| | | * @param pageComShopFundsSearchDTO 店铺资金 |
| | | * @return 店铺资金统计信息 |
| | | */ |
| | | @PostMapping("/pageShopFunds") |
| | | R pageShopFunds(@RequestBody PageComShopFundsSearchDTO pageComShopFundsSearchDTO){ |
| | | return comShopOrderService.pageShopFunds(pageComShopFundsSearchDTO); |
| | | } |
| | | |
| | | /** |
| | | * 微信支付订单回调 |
| | | * @param wxPayNotifyOrderDTO 订单支付回调参数 |
| | | */ |
| | | @PostMapping("/wxOrderPayNotify") |
| | | public void wxOrderPayNotify(@RequestBody WxPayNotifyOrderDTO wxPayNotifyOrderDTO){ |
| | | comShopOrderService.wxOrderPayNotify(wxPayNotifyOrderDTO); |
| | | } |
| | | |
| | | /** |
| | | * 点击去支付订单 |
| | | * @param orderPayDTO 请求参数 |
| | | * @return 支付对象 |
| | | */ |
| | | @PostMapping("/wxPay") |
| | | public R wxPay(@RequestBody OrderPayDTO orderPayDTO){ |
| | | return comShopOrderService.wxPay(orderPayDTO); |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.api; |
| | | |
| | | import com.panzhihua.common.model.dtos.community.PageActWorkGuideDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.ComActWorkGuideVO; |
| | | import com.panzhihua.service_community.service.ComActWorkGuideService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * @auther llming |
| | | * @describe 办事指南 |
| | | */ |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/") |
| | | public class WorkGuideApi { |
| | | @Resource |
| | | private ComActWorkGuideService workGuideService; |
| | | /** |
| | | * 办事指南_新增 |
| | | * @param workGuideVO 新增信息 |
| | | * @return 新增结果 |
| | | */ |
| | | @PostMapping("addworkguide") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R addWorkGuide(@RequestBody ComActWorkGuideVO workGuideVO, @RequestParam("userId")Long userId) { |
| | | return workGuideService.addWorkGuide(workGuideVO,userId); |
| | | } |
| | | |
| | | /** |
| | | * 办事指南_编辑 |
| | | * @param workGuideVO |
| | | * @return 编辑结果 |
| | | */ |
| | | @PostMapping("editworkguide") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R putWorkGuide(@RequestBody ComActWorkGuideVO workGuideVO, @RequestParam("userId")Long userId) { |
| | | return workGuideService.editWorkGuide(workGuideVO,userId); |
| | | } |
| | | |
| | | /** |
| | | * 办事指南_详情 |
| | | * @param workGuideId |
| | | * @return 详情 |
| | | */ |
| | | @GetMapping("detailworkguide") |
| | | public R detailWorkGuide(@RequestParam("workGuideId")Long workGuideId) { |
| | | return workGuideService.detailWorkGuide(workGuideId); |
| | | } |
| | | |
| | | /** |
| | | * 办事指南_分页 |
| | | * @param pageActWorkGuideDTO 查询参数 |
| | | * @return 分页集合 |
| | | */ |
| | | @PostMapping("pageworkguide") |
| | | public R pageWorkGuide(@RequestBody PageActWorkGuideDTO pageActWorkGuideDTO) { |
| | | return workGuideService.pageWorkGuide(pageActWorkGuideDTO); |
| | | } |
| | | /** |
| | | * 办事指南_删除 |
| | | * @param workGuideId 办事指南id |
| | | * @return 删除结果 |
| | | */ |
| | | @PostMapping("delectworkguide") |
| | | R delectWorkGuide(@RequestParam("workGuideId") Long workGuideId){ |
| | | return workGuideService.delectWorkGuide(workGuideId); |
| | | } |
| | | |
| | | } |
| | |
| | | "AND a.`status` in (3,4) \n" + |
| | | " </if> " + |
| | | "<if test='comActActivityVO.isApplets != null and comActActivityVO.isApplets ==1'>" + |
| | | "AND a.`status` != 1 \n" + |
| | | "AND a.`status` != 1 AND a.`status` != 6 \n" + |
| | | " </if> " + |
| | | "<if test='comActActivityVO.beginAt != null '>" + |
| | | "AND a.begin_at <![CDATA[ >= ]]> #{comActActivityVO.beginAt} AND a.end_at <![CDATA[ <= ]]> #{comActActivityVO.endAt} \n" + |
| | |
| | | @Update("update com_act_activity set `status`=3 where `status`=2 and TIMESTAMPDIFF(MINUTE,SYSDATE(),sign_up_begin)<=0") |
| | | int updateStatusToBeginSign(); |
| | | |
| | | @Update("update com_act_activity set `status`=(if(DATEDIFF(SYSDATE(),end_at)>=0,5,4)) where `status` in (3,4) and TIMESTAMPDIFF(MINUTE,SYSDATE(),sign_up_end)<=0") |
| | | @Update("update com_act_activity set `status`=5 where `status` in (3,4) and TIMESTAMPDIFF(MINUTE,SYSDATE(),sign_up_end)<=0") |
| | | int updateStatusToBeginActiveOrEnd(); |
| | | @Select("<script> " + |
| | | "select t.* from (\n" + |
| | |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.apache.ibatis.annotations.Select; |
| | | import org.apache.ibatis.annotations.Update; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | "<if test='comActMicroWishVO.sponsorPhone != null and comActMicroWishVO.sponsorPhone.trim() != ""'>" + |
| | | "AND w.sponsor_phone like concat(#{comActMicroWishVO.sponsorPhone},'%') \n" + |
| | | " </if> " + |
| | | "<if test='comActMicroWishVO.status != null and comActMicroWishVO.status!=0 and comActMicroWishVO.isPageMyWish==null'>" + |
| | | "<if test='comActMicroWishVO.status != null and comActMicroWishVO.status!=0 and comActMicroWishVO.status!=3 and comActMicroWishVO.isPageMyWish==null'>" + |
| | | "AND w.`status` = #{comActMicroWishVO.status} \n" + |
| | | " </if> " + |
| | | "<if test='comActMicroWishVO.status == 3 and comActMicroWishVO.isPageMyWish==null'>" + |
| | | "AND ( w.`status` = 3 or w.`status` = 5 )\n" + |
| | | " </if> " + |
| | | "<if test='comActMicroWishVO.status != null and comActMicroWishVO.status!=0 and comActMicroWishVO.isPageMyWish!=null and comActMicroWishVO.status==1'>" + |
| | | "AND w.`status` in (1,2) \n" + |
| | |
| | | "AND #{comActMicroWishVO.createEnd}" + |
| | | " </if> " + |
| | | "<if test='comActMicroWishVO.isApplets != null and comActMicroWishVO.isApplets != 0'>" + |
| | | "AND w.status in (3,6) \n" + |
| | | "AND w.status in (3, 5, 6) \n" + |
| | | " </if> " + |
| | | "<if test='comActMicroWishVO.userId != null and comActMicroWishVO.userId != 0'>" + |
| | | "AND w.sponsor_id =#{comActMicroWishVO.userId} \n" + |
| | |
| | | "LEFT JOIN com_act_micro_wish_user wu ON w.id = wu.micro_wish_id \n" + |
| | | "WHERE\n" + |
| | | "w.id =#{id}"+ |
| | | " group by w.id " |
| | | " group by w.id " + |
| | | "order by w.create_at desc" |
| | | ) |
| | | ComActMicroWishVO detailMicroWish(Long id); |
| | | @Select("SELECT\n" + |
| | |
| | | "GROUP BY\n" + |
| | | "\tw.community_id\n") |
| | | List<TodoEventsVO> selectNeedToDo(@Param("communityId") Long communityId, @Param("userId") Long userId); |
| | | |
| | | @Update("update com_act_micro_wish set `status`=6 where `status`=5 and TIMESTAMPDIFF(HOUR, feedback_at, SYSDATE())>=72") |
| | | int updateStatusAutoConfirm(); |
| | | |
| | | } |
| | |
| | | " com_act_questnaire aq \n" + |
| | | " LEFT JOIN sys_user u on aq.create_by = u.user_id \n" + |
| | | " where aq.is_hide=0 " + |
| | | "<if test='communityId != null and communityId!=0 '>\n" + |
| | | "<if test='communityId != null and communityId!=0l '>\n" + |
| | | " and aq.community_id = #{communityId}\n" + |
| | | " </if> " + |
| | | "<if test='pageQuestnaireDTO.state != null '>\n" + |
| | |
| | | " </if> \n" + |
| | | |
| | | "<if test='pageQuestnaireDTO.startTime != null '>\n" + |
| | | " AND aq.create_at BETWEEN \n" + |
| | | "#{pageComActDTO.startTime} \n" + |
| | | " AND #{pageQuestnaireDTO.endTime}\n" + |
| | | " AND aq.create_at <![CDATA[>=]]> #{pageQuestnaireDTO.startTime} \n" + |
| | | "</if>" + |
| | | "<if test='pageQuestnaireDTO.endTime != null '>\n" + |
| | | " AND aq.create_at <![CDATA[<=]]> #{pageQuestnaireDTO.endTime} \n" + |
| | | " </if> \n" + |
| | | " ORDER BY \n" + |
| | | " aq.create_at DESC" + |
New file |
| | |
| | | package com.panzhihua.service_community.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.panzhihua.common.model.dtos.community.PageActWorkGuideDTO; |
| | | import com.panzhihua.common.model.vos.community.ComActWorkGuideVO; |
| | | import com.panzhihua.service_community.model.dos.ComActWorkGuideDO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.apache.ibatis.annotations.Select; |
| | | |
| | | |
| | | /** |
| | | * @description: 办事指南 |
| | | **/ |
| | | @Mapper |
| | | public interface ComActWorkGuideDAO extends BaseMapper<ComActWorkGuideDO> { |
| | | @Select("<script> " + |
| | | "select id ,title,content,time_at,address,phone from com_act_work_guide " + |
| | | " <where>" + |
| | | "<if test='pageActWorkGuideDTO.title != null and pageActWorkGuideDTO.title.trim() != ""'>" + |
| | | "title like concat('%',#{pageActWorkGuideDTO.title},'%')"+ |
| | | " </if> " + |
| | | " </where>" + |
| | | "order by create_at desc"+ |
| | | "</script>") |
| | | IPage<ComActWorkGuideVO> pageWorkGuide(Page page, @Param("pageActWorkGuideDTO") PageActWorkGuideDTO pageActWorkGuideDTO); |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.panzhihua.service_community.model.dos.ComActWorkGuideMaterialDO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | |
| | | /** |
| | | * @description: 办事指南材料 |
| | | **/ |
| | | @Mapper |
| | | public interface ComActWorkGuideMaterialDAO extends BaseMapper<ComActWorkGuideMaterialDO> { |
| | | } |
| | |
| | | "LEFT JOIN sys_user u ON a.create_by = u.user_id "+ |
| | | " <where>" + |
| | | "<if test='pageComCvtBusinessDTO.name != null and pageComCvtBusinessDTO.name.trim() != ""'>" + |
| | | " and a.name LIKE concat( #{pageComCvtBusinessDTO.name}, '%' ) " + |
| | | " and a.name LIKE concat( '%', #{pageComCvtBusinessDTO.name}, '%' ) " + |
| | | " </if> " + |
| | | "<if test='pageComCvtBusinessDTO.communityId != null and pageComCvtBusinessDTO.communityId != 0'>" + |
| | | " and a.community_id = #{pageComCvtBusinessDTO.communityId} " + |
| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.panzhihua.common.model.dtos.community.ComMngPopulationDTO; |
| | | import com.panzhihua.common.model.dtos.user.PageInputUserDTO; |
| | | import com.panzhihua.common.model.vos.community.ComActMessageVO; |
| | | import com.panzhihua.common.model.vos.community.ComMngPopulationVO; |
| | | import com.panzhihua.common.model.vos.community.PageComActMessageVO; |
| | | import com.panzhihua.common.model.vos.user.ComHouseMemberVo; |
| | | import com.panzhihua.common.model.vos.user.ComMngFamilyInfoVO; |
| | | import com.panzhihua.common.model.vos.user.InputUserInfoVO; |
| | | import com.panzhihua.common.model.vos.user.UserElectronicFileVO; |
| | | import com.panzhihua.service_community.model.dos.ComMngPopulationDO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | |
| | | List<ComMngPopulationVO> listPopulation(ComMngPopulationDTO populationVO); |
| | | |
| | | |
| | | @Select("select id,user_id,relationship,`name`,id_card,phone,age,health,job,create_at,update_at from com_mng_family_info where user_id=#{userId}") |
| | | @Select("select id,user_id,relationship,`name`,id_card,phone,age,health,job,create_at,update_at,card_photo_front,card_photo_back,family_book from com_mng_family_info where user_id=#{userId}") |
| | | List<ComMngFamilyInfoVO> listFamilyByUserId(Long userId); |
| | | |
| | | @Select("select id,`name`,phone,relation from com_mng_population where road = #{comMngPopulationDO.road} and door_no = #{comMngPopulationDO.doorNo} and floor = #{comMngPopulationDO.floor} and unit_no = #{comMngPopulationDO.unitNo} and house_no = #{comMngPopulationDO.houseNo} and id != #{comMngPopulationDO.id}") |
| | |
| | | "<where>" + |
| | | "<if test='comMngPopulationVO.name != null and comMngPopulationVO.name != ""'>" + |
| | | "AND cmp.`name` LIKE concat(#{comMngPopulationVO.name},'%') " + |
| | | " </if> " + |
| | | "<if test='comMngPopulationVO.actId != null'>" + |
| | | " and cmp.act_id = #{comMngPopulationVO.actId} " + |
| | | " </if> " + |
| | | "<if test='comMngPopulationVO.road != null and comMngPopulationVO.road != ""'>" + |
| | | "AND cmp.road LIKE concat(#{comMngPopulationVO.road},'%') " + |
| | |
| | | "</script>") |
| | | IPage<ComMngPopulationVO> pagePopulation(Page page, @Param("comMngPopulationVO") ComMngPopulationDTO comMngPopulationVO); |
| | | |
| | | @Select("<script> " + |
| | | "select cmp.id,cmv.`alley` as areaName,cmp.`name`,cmp.phone,cmp.label as tags,cmp.create_at from com_mng_population as cmp " + |
| | | "left join com_mng_village as cmv on cmv.village_id = cmp.village_id where cmp.act_id = #{pageInputUserDTO.communityId} and cmp.label is not null " + |
| | | "<if test='pageInputUserDTO.name != null and pageInputUserDTO.name != ""'>" + |
| | | " AND cmp.`name` LIKE concat(#{pageInputUserDTO.name},'%') " + |
| | | " </if> " + |
| | | "<if test='pageInputUserDTO.areaName != null and pageInputUserDTO.areaName != ""'>" + |
| | | " AND cmv.`alley` LIKE concat(#{pageInputUserDTO.areaName},'%') " + |
| | | " </if> " + |
| | | "<if test='pageInputUserDTO.tags != null and pageInputUserDTO.tags != ""'>" + |
| | | " AND cmp.label like concat('%',#{pageInputUserDTO.tags},'%') " + |
| | | " </if> " + |
| | | " order by cmp.create_at desc " + |
| | | "</script>") |
| | | IPage<InputUserInfoVO> specialInputUser(Page page, @Param("pageInputUserDTO") PageInputUserDTO pageInputUserDTO); |
| | | |
| | | @Select("select user_id,card_photo_front,card_photo_back,family_book from sys_user where id_card=#{idCard}") |
| | | UserElectronicFileVO getSysUserElectronicFile(@Param("idCard") String idCard); |
| | | |
| | | |
| | | } |
| | |
| | | "b.name like concat(#{comMngStructOtherBuildVO.name},'%') "+ |
| | | " </if> " + |
| | | " </where>" + |
| | | " order by b.create_at desc" + |
| | | "</script>") |
| | | IPage<ComMngStructOtherBuildVO> pageOtherBuild(Page page, @Param("comMngStructOtherBuildVO") ComMngStructOtherBuildVO comMngStructOtherBuildVO); |
| | | |
| | |
| | | "t.state,\n" + |
| | | "t.phone,\n" + |
| | | "t.apply_reson,\n" + |
| | | "t.create_at \n" + |
| | | "t.create_at, " + |
| | | "t.submit_user_id \n" + |
| | | "FROM\n" + |
| | | "com_mng_volunteer_mng t\n" + |
| | | " RIGHT JOIN \n" + |
| | | "(select phone, MAX(create_at)create_at from com_mng_volunteer_mng where state IN ( 1, 3 ) GROUP BY phone ) tmp \n" + |
| | | "on t.create_at = tmp.create_at and t.phone=tmp.phone "+ |
| | | "(select submit_user_id, MAX(create_at)create_at from com_mng_volunteer_mng where state IN ( 1, 3 ) GROUP BY submit_user_id ) tmp \n" + |
| | | "on t.create_at = tmp.create_at and t.submit_user_id=tmp.submit_user_id "+ |
| | | "WHERE\n" + |
| | | "state in (1,3) and community_id=#{comMngVolunteerMngVO.communityId} \n" + |
| | | "<if test='comMngVolunteerMngVO.name != null and comMngVolunteerMngVO.name.trim() != ""'>" + |
| | |
| | | "AND #{pageComOpsAdvDTO.offAtEnd}"+ |
| | | " </if> " + |
| | | " </where>" + |
| | | " order by a.create_at desc" + |
| | | "</script>") |
| | | IPage<ComOpsAdvVO> pageAdvertisement(Page page, @Param("pageComOpsAdvDTO") PageComOpsAdvDTO pageComOpsAdvDTO); |
| | | @Select("SELECT \n" + |
| | |
| | | "JOIN com_ops_adv_pos po on a.pos_id=po.id\n" + |
| | | "LEFT JOIN com_ops_adv_jump p on a.jump_id=p.id\n" + |
| | | "WHERE\n" + |
| | | "a.id=#{id} ") |
| | | "a.id=#{id} " ) |
| | | ComOpsAdvVO detailAdvertisement(Long id); |
| | | } |
| | |
| | | @Select("select type,name,phone,image_url from sys_user where user_id=#{userId}") |
| | | LoginUserInfoVO selectUserByUserId(Long userId); |
| | | |
| | | @Select("select user_id from sys_user where user_id=#{name} limit 1") |
| | | @Select("select user_id from sys_user where name like concat('%',#{name},'%') limit 1") |
| | | Long selectUserIdByName(String name); |
| | | |
| | | @Select("<script> " + |
| | |
| | | "AND d.status in (1,3) \n" + |
| | | " </if> " + |
| | | "<if test='pageComOpsHouseDTO.houseCommunityName != null and pageComOpsHouseDTO.houseCommunityName.trim() != ""'>" + |
| | | " and d.`house_community_name` LIKE concat( #{pageComOpsHouseDTO.houseCommunityName}, '%' ) \n" + |
| | | " and (" + |
| | | " d.`house_community_name` LIKE concat( '%', #{pageComOpsHouseDTO.houseCommunityName}, '%' ) " + |
| | | " or d.title like concat( '%', #{pageComOpsHouseDTO.houseCommunityName}, '%' ) " + |
| | | " ) \n" + |
| | | " </if> " + |
| | | "<if test='pageComOpsHouseDTO.mobile != null and pageComOpsHouseDTO.mobile.trim() != ""'>" + |
| | | " and d.`mobile` LIKE concat( #{pageComOpsHouseDTO.mobile}, '%' ) \n" + |
| | |
| | | package com.panzhihua.service_community.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.panzhihua.common.model.vos.shop.ComShopGoodsAttrVO; |
| | | import com.panzhihua.service_community.model.dos.ComShopGoodsAttrDO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.apache.ibatis.annotations.Select; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @auther lyq |
| | |
| | | @Mapper |
| | | public interface ComShopGoodsAttrDAO extends BaseMapper<ComShopGoodsAttrDO> { |
| | | |
| | | @Select("select id,goods_id as goodsId,store_id as storeId,goods_name as goodsName,goods_attr as goodsAttr,stock,sale,attr_pic as attrPic,is_default as isDefault,price from com_shop_goods_attr where goods_id = #{goodsId}") |
| | | List<ComShopGoodsAttrVO> getGoodsAttr(@Param("goodsId") Long goodsId); |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.panzhihua.common.model.dtos.shop.ComShopGoodsDTO; |
| | | import com.panzhihua.common.model.dtos.shop.PageComShopStoreDTO; |
| | | import com.panzhihua.common.model.vos.shop.ComShopGoodsVO; |
| | | import com.panzhihua.common.model.vos.shop.PageShopStoreVO; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.panzhihua.common.model.dtos.shop.PageComShopGoodsDTO; |
| | | import com.panzhihua.common.model.vos.shop.ComShopStoreVO; |
| | | import com.panzhihua.common.model.vos.shop.PageShopGoodsVO; |
| | | import com.panzhihua.common.model.vos.shop.PageShopStoreVO; |
| | | import com.panzhihua.service_community.model.dos.ComShopGoodsDO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.apache.ibatis.annotations.Select; |
| | | |
| | | /** |
| | |
| | | @Mapper |
| | | public interface ComShopGoodsDAO extends BaseMapper<ComShopGoodsDO> { |
| | | |
| | | @Select("select id,type_id,name,store_id,goods_pic,images,status,sale,original_price,price,unit,order,stock,details,remark,goods_describe,delivery_type,delete_status,create_at,update_at from com_shop_store") |
| | | IPage<ComShopStoreVO> pageShopGoods(Page page, PageComShopGoodsDTO pageComShopGoodsDTO); |
| | | @Select("<script>" + |
| | | "select c.id,c.type_id,css.name as storeName,c.name,c.store_id,c.goods_pic,c.images,c.status,c.sale,c.original_price,c.price,c.unit,c.order,c.stock,c.details,c.remark,c.goods_describe,c.delivery_type,c.delete_status,c.create_at,c.update_at from com_shop_goods c \n" + |
| | | " left join com_shop_store css on c.store_id=css.id\n" + |
| | | " <where>" + |
| | | " and c.delete_status = 1 and css.delete_status = 1 " + |
| | | "<if test='pageComShopGoodsDTO.storeName != null and pageComShopGoodsDTO.storeName.trim() != ""'>" + |
| | | "and css.name like concat('%',#{pageComShopGoodsDTO.storeName},'%') \n" + |
| | | " </if> " + |
| | | "<if test='pageComShopGoodsDTO.name != null and pageComShopGoodsDTO.name.trim() != ""'>" + |
| | | "and c.name like concat('%',#{pageComShopGoodsDTO.name},'%') \n" + |
| | | " </if> " + |
| | | "<if test='pageComShopGoodsDTO.storeId != null'>" + |
| | | "and css.id=#{pageComShopGoodsDTO.storeId} \n" + |
| | | " </if> " + |
| | | "<if test='pageComShopGoodsDTO.status != null'>" + |
| | | "and c.status like concat('%',#{pageComShopGoodsDTO.status},'%') \n" + |
| | | " </if> " + |
| | | " </where>" + |
| | | " order by c.create_at desc" + |
| | | "</script>") |
| | | IPage<PageShopGoodsVO> pageShopGoods(Page page, @Param("pageComShopGoodsDTO") PageComShopGoodsDTO pageComShopGoodsDTO); |
| | | |
| | | /** |
| | | * 根据店铺id查询商品列表 |
| | | * |
| | | * @param page 分页参数 |
| | | * @param pageComShopStoreDTO 请求参数 |
| | | * @return 分页商品列表 |
| | | */ |
| | | @Select("<script> " + |
| | | "select id,`name`,store_id,goods_pic,images,`status`,sale,original_price,price" + |
| | | ",unit,`order`,stock,details,delivery_type from com_shop_goods" + |
| | | " where store_id = #{pageComShopStoreDTO.storeId} and delete_status = 1 and status = 1" + |
| | | " order by sale desc,create_at desc " + |
| | | "</script> ") |
| | | IPage<ComShopGoodsVO> pageShopGoodsByStoreId(Page page, @Param("pageComShopStoreDTO") PageComShopStoreDTO pageComShopStoreDTO); |
| | | |
| | | /** |
| | | * 分页查询商品列表 |
| | | * |
| | | * @param page 分页参数 |
| | | * @param comShopGoodsDTO 请求参数 |
| | | * @return 商品列表 |
| | | */ |
| | | @Select("<script> " + |
| | | "select csg.id,csg.`name`,csg.store_id,csg.goods_pic,csg.images,csg.`status`,csg.sale,csg.original_price " + |
| | | ",csg.price,csg.unit,csg.`order`,csg.stock,csg.details,csg.delivery_type, csg.create_at " + |
| | | " from com_shop_goods as csg " + |
| | | " left join com_shop_store as css on css.id = csg.store_id " + |
| | | " where 1=1 and csg.delete_status = 1 and css.`status` = 1" + |
| | | "<if test='comShopGoodsDTO.name != null and comShopGoodsDTO.name !=""'>" + |
| | | " AND csg.`name` like concat('%',#{comShopGoodsDTO.name},'%') " + |
| | | " </if> " + |
| | | "<if test='comShopGoodsDTO.status != null '>" + |
| | | " AND csg.`status` = #{comShopGoodsDTO.status}" + |
| | | " </if> " + |
| | | "<if test='comShopGoodsDTO.storeId != null '>" + |
| | | " AND csg.store_id = #{comShopGoodsDTO.storeId} " + |
| | | " </if> " + |
| | | "<if test='comShopGoodsDTO.status != null '>" + |
| | | " AND csg.status = #{comShopGoodsDTO.status} " + |
| | | " </if> " + |
| | | "<if test='comShopGoodsDTO.deliveryType != null '>" + |
| | | " AND csg.delivery_type = #{comShopGoodsDTO.deliveryType} " + |
| | | " </if> " + |
| | | " order by sale desc,create_at desc " + |
| | | " </script>") |
| | | IPage<ComShopGoodsVO> pageShopGoodByApps(Page page, @Param("comShopGoodsDTO") ComShopGoodsDTO comShopGoodsDTO); |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.panzhihua.service_community.model.dos.ComShopOperLogDO; |
| | | import com.panzhihua.service_community.model.dos.ComShopOrderDO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * @author cedoo |
| | | * @create 2021-4-17 10:55:15 |
| | | * @describe 订单日志mapper类 |
| | | */ |
| | | @Mapper |
| | | public interface ComShopOperLogDAO extends BaseMapper<ComShopOperLogDO> { |
| | | |
| | | } |
| | |
| | | package com.panzhihua.service_community.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.panzhihua.common.model.dtos.shop.PageComOrderListDTO; |
| | | import com.panzhihua.common.model.vos.shop.*; |
| | | import com.panzhihua.common.model.dtos.shop.*; |
| | | import com.panzhihua.common.model.vos.shop.*; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.panzhihua.common.model.dtos.PageDTO; |
| | | import com.panzhihua.common.model.vos.shop.ComShopOrderVO; |
| | | import com.panzhihua.service_community.model.dos.ComShopOrderDO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.apache.ibatis.annotations.Select; |
| | | |
| | | /** |
| | | * @auther lyq |
| | | * @create 2021-04-14 15:03:01 |
| | | * @auther cedoo |
| | | * @create 2021-4-17 17:35:51 |
| | | * @describe 订单表mapper类 |
| | | */ |
| | | @Mapper |
| | | public interface ComShopOrderDAO extends BaseMapper<ComShopOrderDO> { |
| | | |
| | | @Select("<script> " + |
| | | "select id as orderId,order_no,store_id,`status`,pay_status,receiver_id,total_amount as orderTotal,pay_amount,delivery_type,remark,create_at from com_shop_order as cso" + |
| | | " where 1=1 and cso.delete_status = 1 and cso.user_id = #{comOrderListDTO.userId}" + |
| | | "<if test='comOrderListDTO.status != null'>" + |
| | | " AND cso.status = #{comOrderListDTO.status} " + |
| | | " </if> " + |
| | | " order by create_at desc " + |
| | | " </script>") |
| | | IPage<ComShopOrderPageVO> pageOrderList(Page page,@Param("comOrderListDTO") PageComOrderListDTO comOrderListDTO); |
| | | |
| | | @Select("<script> " + |
| | | "SELECT distinct sr.id, sr.store_id, sr.user_id, su.phone AS userName , sr.order_no, sr.pay_no, \n" + |
| | | " sr.wx_tarde_no, sr.status, sr.pay_status, sr.receiver_id, \n" + |
| | | " sr.total_amount, sr.discount_amount, sr.pay_amount, sr.pay_type, \n" + |
| | | " sr.pay_time, sr.delivery_type, sr.delivery_status, sr.logistics_company, \n" + |
| | | " sr.logistics_no, sr.create_at, uad.name as receiver_name, uad.phone as receiver_phone, group_concat(og.goods_name) as goodsName, ss.name as store_name \n" + |
| | | " FROM com_shop_order sr LEFT JOIN com_shop_order_goods og ON sr.id = og.order_id \n" + |
| | | " LEFT JOIN com_shop_goods_attr ga ON og.goods_attr_id = ga.id \n" + |
| | | " LEFT JOIN sys_user su ON sr.user_id = su.user_id \n" + |
| | | " LEFT JOIN com_shop_user_address uad ON sr.receiver_id = uad.id \n" + |
| | | " LEFT JOIN com_shop_store ss ON sr.store_id = ss.id \n" + |
| | | " WHERE sr.delete_status = 1" + |
| | | "<if test='pageComShopOrderSearchDTO.userId != null'>" + |
| | | " AND sr.user_id = #{pageComShopOrderSearchDTO.userId} " + |
| | | " </if> " + |
| | | "<if test='pageComShopOrderSearchDTO.createAtStart != null'>" + |
| | | " AND #{pageComShopOrderSearchDTO.createAtStart} <![CDATA[<=]]> sr.create_at " + |
| | | " </if> " + |
| | | "<if test='pageComShopOrderSearchDTO.createAtEnd != null'>" + |
| | | " AND sr.create_at <![CDATA[<=]]> #{pageComShopOrderSearchDTO.createAtEnd} " + |
| | | " </if> " + |
| | | "<if test='pageComShopOrderSearchDTO.orderNo != null '>" + |
| | | " AND sr.order_no like concat('%', #{pageComShopOrderSearchDTO.orderNo}, '%') " + |
| | | " </if> " + |
| | | "<if test='pageComShopOrderSearchDTO.userAccount != null '>" + |
| | | " AND su.phone like concat('%', #{pageComShopOrderSearchDTO.userAccount}, '%') " + |
| | | " </if> " + |
| | | "<if test='pageComShopOrderSearchDTO.receiverAccount != null '>" + |
| | | " AND uad.name like concat('%', #{pageComShopOrderSearchDTO.receiverAccount}, '%') " + |
| | | " </if> " + |
| | | "<if test='pageComShopOrderSearchDTO.receiverPhone != null '>" + |
| | | " AND uad.phone like concat('%',#{pageComShopOrderSearchDTO.receiverPhone}, '%') " + |
| | | " </if> " + |
| | | "<if test='pageComShopOrderSearchDTO.goodsName != null'>" + |
| | | " AND og.goods_name like concat('%', #{pageComShopOrderSearchDTO.goodsName}, '%') " + |
| | | " </if> " + |
| | | "<if test='pageComShopOrderSearchDTO.status != null '>" + |
| | | " AND sr.status = #{pageComShopOrderSearchDTO.status} " + |
| | | " </if> " + |
| | | "<if test='pageComShopOrderSearchDTO.storeName != null '>" + |
| | | " AND ss.name like concat('%', #{pageComShopOrderSearchDTO.storeName}, '%') " + |
| | | " </if> " + |
| | | "<if test='pageComShopOrderSearchDTO.storeId != null '>" + |
| | | " AND ss.id = #{pageComShopOrderSearchDTO.storeId} " + |
| | | " </if> " + |
| | | "<if test='pageComShopOrderSearchDTO.storeUserId != null '>" + |
| | | " AND ss.sys_user_id = #{pageComShopOrderSearchDTO.storeUserId} " + |
| | | " </if> " + |
| | | " GROUP BY sr.id " + |
| | | " ORDER BY sr.create_at DESC "+ |
| | | "</script>") |
| | | IPage<ComShopOrderSearchVO> pageOrderBy(Page page, @Param("pageComShopOrderSearchDTO") PageComShopOrderSearchDTO pageComShopOrderSearchDTO); |
| | | |
| | | @Select("<script> " + |
| | | "SELECT sr.total_amount AS goods_total, GROUP_CONCAT(og.goods_name separator '\n') AS goods_name , sum(og.amount) AS goods_count, " + |
| | | " su.phone AS account, uad.name AS receiver, uad.phone AS receiverPhone, \n" + |
| | | " concat(uad.province_name, uad.city_name, uad.district_name, uad.detail_address) AS receiver_address, ss.name AS storeName, sr.remark," + |
| | | " CASE\n" + |
| | | " WHEN sr.`status` = 1 THEN '待付款' \n" + |
| | | " WHEN sr.`status` = 2 THEN '待发货' \n" + |
| | | " WHEN sr.`status` = 3 THEN '待收货' \n" + |
| | | " WHEN sr.`status` = 4 THEN '待评价' \n" + |
| | | " WHEN sr.`status` = 5 THEN '已完成' \n" + |
| | | " WHEN sr.`status` = 5 THEN '已取消' \n" + |
| | | " ELSE '---' \n" + |
| | | " END AS 'status' , " + |
| | | " sr.create_at, " + |
| | | " CASE WHEN sr.pay_time IS NOT NULL THEN sr.pay_time ELSE '---' END AS pay_time " + |
| | | " FROM com_shop_order sr LEFT JOIN com_shop_order_goods og ON sr.id = og.order_id \n" + |
| | | " LEFT JOIN com_shop_goods_attr ga ON og.goods_attr_id = ga.id \n" + |
| | | " LEFT JOIN sys_user su ON sr.user_id = su.user_id \n" + |
| | | " LEFT JOIN com_shop_user_address uad ON sr.receiver_id = uad.id \n" + |
| | | " LEFT JOIN com_shop_store ss ON sr.store_id = ss.id \n" + |
| | | " WHERE sr.delete_status = 1" + |
| | | "<if test='comShopOrderExportDTO.userId != null'>" + |
| | | " AND sr.user_id = #{comShopOrderExportDTO.userId} " + |
| | | " </if> " + |
| | | "<if test='comShopOrderExportDTO.storeUserId != null '>" + |
| | | " AND ss.sys_user_id = #{comShopOrderExportDTO.storeUserId} " + |
| | | " </if> " + |
| | | "<if test='comShopOrderExportDTO.orderIds != null and comShopOrderExportDTO.orderIds.length>0 '>" + |
| | | " AND sr.id in " + |
| | | "<foreach collection='comShopOrderExportDTO.orderIds' item='id' index='index' open='(' close=')' separator=',' >\n" + |
| | | " #{id}" + |
| | | "</foreach>" + |
| | | " </if> " + |
| | | |
| | | "<if test='comShopOrderExportDTO.orderIds == null or comShopOrderExportDTO.orderIds.length==0 '>" + |
| | | "<if test='comShopOrderExportDTO.createAtStart != null '>" + |
| | | " AND #{comShopOrderExportDTO.createAtStart} <![CDATA[<=]]> sr.create_at " + |
| | | " </if> " + |
| | | "<if test='comShopOrderExportDTO.createAtEnd != null'>" + |
| | | " AND sr.create_at <![CDATA[<=]]> #{comShopOrderExportDTO.createAtEnd} " + |
| | | " </if> " + |
| | | "<if test='comShopOrderExportDTO.orderNo != null '>" + |
| | | " AND sr.order_no = #{comShopOrderExportDTO.orderNo} " + |
| | | " </if> " + |
| | | "<if test='comShopOrderExportDTO.userAccount != null '>" + |
| | | " AND su.phone = #{comShopOrderExportDTO.userAccount} " + |
| | | " </if> " + |
| | | "<if test='comShopOrderExportDTO.receiverAccount != null'>" + |
| | | " AND uad.name = #{comShopOrderExportDTO.receiverAccount} " + |
| | | " </if> " + |
| | | "<if test='comShopOrderExportDTO.receiverPhone != null '>" + |
| | | " AND uad.phone = #{comShopOrderExportDTO.receiverPhone} " + |
| | | " </if> " + |
| | | "<if test='comShopOrderExportDTO.goodsName != null '>" + |
| | | " AND og.name like concat('%', #{comShopOrderExportDTO.goodsName}, '%') " + |
| | | " </if> " + |
| | | "<if test='comShopOrderExportDTO.status != null '>" + |
| | | " AND sr.status = #{comShopOrderExportDTO.status} " + |
| | | " </if> " + |
| | | " </if> " + |
| | | " GROUP BY sr.id ORDER BY sr.create_at "+ |
| | | "</script>") |
| | | IPage<ExcelShopOrderDTO> selectOrderExport(Page page, @Param("comShopOrderExportDTO") ComShopOrderExportDTO comShopOrderExportDTO); |
| | | |
| | | @Select("<script> " + |
| | | "SELECT sr.total_amount, sr.pay_time, sr.order_no, \n" + |
| | | " CASE WHEN sr.pay_type = 1 THEN '微信支付' ELSE '' END AS payType, \n" + |
| | | " '收入' AS 'type' " + |
| | | "FROM com_shop_order sr LEFT JOIN com_shop_store st ON sr.store_id = st.id \n" + |
| | | " WHERE sr.pay_status = 2 AND sr.delete_status=1 " + |
| | | "<if test='comShopFundsExportDTO.userId != null'>" + |
| | | " AND st.sys_user_id = #{comShopFundsExportDTO.userId} " + |
| | | " </if> " + |
| | | "<if test='comShopFundsExportDTO.orderIds != null and comShopFundsExportDTO.orderIds.length>0 '>" + |
| | | " AND sr.id in " + |
| | | "<foreach collection='comShopFundsExportDTO.orderIds' item='id' index='index' open='(' close=')' separator=',' >\n" + |
| | | " #{id}" + |
| | | "</foreach>" + |
| | | " </if> " + |
| | | "<if test='comShopFundsExportDTO.orderIds == null or comShopFundsExportDTO.orderIds.length==0 '>" + |
| | | "<if test='comShopFundsExportDTO.payTimeStart != null'>" + |
| | | " AND #{comShopFundsExportDTO.payTimeStart} <![CDATA[<=]]> sr.pay_time " + |
| | | " </if> " + |
| | | "<if test='comShopFundsExportDTO.payTimeEnd != null'>" + |
| | | " AND sr.pay_time <![CDATA[<=]]> #{comShopFundsExportDTO.payTimeEnd} " + |
| | | " </if> " + |
| | | "<if test='comShopFundsExportDTO.orderNo != null '>" + |
| | | " AND sr.order_no = #{comShopFundsExportDTO.orderNo} " + |
| | | " </if> " + |
| | | " </if> " + |
| | | " GROUP BY sr.id ORDER BY sr.create_at "+ |
| | | "</script>") |
| | | IPage<ExcelShopFundsDTO> selectFundsExport(Page page, @Param("comShopFundsExportDTO") ComShopFundsExportDTO comShopFundsExportDTO); |
| | | |
| | | @Select("<script> " + |
| | | " SELECT sys_user_id,\n" + |
| | | " COALESCE(SUM(CASE WHEN abt.days = DATE_FORMAT(NOW(),'%Y%m%d') THEN abt.t END), 0) AS todayTotal,\n" + |
| | | " COALESCE(SUM(CASE WHEN abt.days = DATE_FORMAT(NOW(),'%Y%u') THEN abt.t END), 0) AS weekTotal,\n" + |
| | | " COALESCE(SUM(CASE WHEN abt.days = DATE_FORMAT(NOW(),'%Y%m') THEN abt.t END), 0) AS monthTotal\n" + |
| | | "FROM (\n" + |
| | | "SELECT ss.sys_user_id, sum(sr.pay_amount) AS t , DATE_FORMAT(sr.pay_time,'%Y%m%d') days\n" + |
| | | "FROM com_shop_order sr LEFT JOIN com_shop_store ss ON sr.store_id = ss.id\n" + |
| | | "WHERE sr.pay_status = 2 AND DATE_FORMAT(sr.pay_time,'%Y%m%d') = DATE_FORMAT(NOW(),'%Y%m%d')\n" + |
| | | "<if test='userId!=null and userId!=0L'>" + |
| | | " and ss.sys_user_id = #{userId}\n" + |
| | | "</if>" + |
| | | "GROUP BY days\n" + |
| | | "UNION \n" + |
| | | "SELECT ss.sys_user_id, sum(sr.pay_amount) AS t, DATE_FORMAT(sr.pay_time,'%Y%u') weeks\n" + |
| | | "FROM com_shop_order sr LEFT JOIN com_shop_store ss ON sr.store_id = ss.id\n" + |
| | | "WHERE sr.pay_status = 2 AND DATE_FORMAT(sr.pay_time,'%Y%u') = DATE_FORMAT(NOW(),'%Y%u')\n" + |
| | | "<if test='userId!=null and userId!=0L'>" + |
| | | " and ss.sys_user_id = #{userId}\n" + |
| | | "</if>" + |
| | | "GROUP BY weeks\n" + |
| | | "UNION \n" + |
| | | "SELECT ss.sys_user_id, sum(sr.pay_amount) AS t, DATE_FORMAT(sr.pay_time,'%Y%m') months\n" + |
| | | "FROM com_shop_order sr LEFT JOIN com_shop_store ss ON sr.store_id = ss.id\n" + |
| | | "WHERE sr.pay_status = 2 AND DATE_FORMAT(sr.pay_time,'%Y%m') = DATE_FORMAT(NOW(),'%Y%m')\n" + |
| | | "<if test='userId!=null and userId!=0L'>" + |
| | | " and ss.sys_user_id = #{userId}\n" + |
| | | "</if>" + |
| | | "GROUP BY months\n" + |
| | | ") abt\n" + |
| | | "GROUP BY abt.sys_user_id "+ |
| | | "</script>") |
| | | ComShopFundsVO queryStatis(@Param("userId") Long userId); |
| | | |
| | | @Select("<script> " + |
| | | "SELECT sr.id, sr.total_amount, sr.pay_time, sr.order_no, \n" + |
| | | " CASE WHEN sr.pay_type = 1 THEN '微信支付' ELSE '' END AS payType, \n" + |
| | | " '收入' AS 'type' " + |
| | | "FROM com_shop_order sr LEFT JOIN com_shop_store st ON sr.store_id = st.id \n" + |
| | | " WHERE sr.pay_status = 2 AND sr.delete_status=1 " + |
| | | "<if test='pageComShopFundsSearchDTO.userId != null'>" + |
| | | " AND st.sys_user_id = #{pageComShopFundsSearchDTO.userId} " + |
| | | " </if> " + |
| | | "<if test='pageComShopFundsSearchDTO.payTimeStart != null'>" + |
| | | " AND #{pageComShopFundsSearchDTO.payTimeStart} <![CDATA[<=]]> sr.pay_time " + |
| | | " </if> " + |
| | | "<if test='pageComShopFundsSearchDTO.payTimeEnd != null'>" + |
| | | " AND sr.pay_time <![CDATA[<=]]> #{pageComShopFundsSearchDTO.payTimeEnd} " + |
| | | " </if> " + |
| | | "<if test='pageComShopFundsSearchDTO.orderNo != null '>" + |
| | | " AND sr.order_no = #{pageComShopFundsSearchDTO.orderNo} " + |
| | | " </if> " + |
| | | " GROUP BY sr.id ORDER BY sr.create_at DESC "+ |
| | | "</script>") |
| | | IPage<ComShopFundsOrderVO> pageShopFunds(Page page, @Param("pageComShopFundsSearchDTO") PageComShopFundsSearchDTO pageComShopFundsSearchDTO); |
| | | |
| | | @Select("<script> " + |
| | | "SELECT\n" + |
| | | "css.store_account,\n" + |
| | | "css.`contacts`,\n" + |
| | | "css.`name` as storeName,\n" + |
| | | "cso.total_amount,\n" + |
| | | "cso.pay_type,\n" + |
| | | "cso.pay_time, \n" + |
| | | "cso.create_at, \n" + |
| | | "cso.order_no\n" + |
| | | "FROM\n" + |
| | | "com_shop_order cso\n" + |
| | | "left JOIN com_shop_store css on cso.store_id=css.id \n" + |
| | | "where cso.id =#{id} "+ |
| | | "</script>") |
| | | CapitalDetailVO capitalDetailByStore(@Param("id")Long id); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.panzhihua.common.model.dtos.shop.PageComShopStoreDTO; |
| | | import com.panzhihua.common.model.vos.shop.ComShopStoreVO; |
| | | import com.panzhihua.common.model.vos.shop.PageShopStoreVO; |
| | | import com.panzhihua.service_community.model.dos.ComShopStoreDO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | |
| | | @Mapper |
| | | public interface ComShopStoreDAO extends BaseMapper<ComShopStoreDO> { |
| | | |
| | | @Select("select id,`name`,classify_id,logo,phone,delivery_type,remark,`status`,sale,sale_volume,store_detail from com_shop_store") |
| | | IPage<ComShopStoreVO> pageShopStore(Page page, @Param("pageComShopStoreDTO") PageComShopStoreDTO pageComShopStoreDTO); |
| | | @Select("<script>" + |
| | | "select id,`name`,store_password,contacts,store_account,classify_id,logo,phone,delivery_type,remark,`status`," + |
| | | "sale,sale_volume,store_detail,create_at, store_describe from com_shop_store c" + |
| | | " <where>" + |
| | | "c.delete_status=1 and c.status = 1" + |
| | | "<if test='pageComShopStoreDTO.contacts != null and pageComShopStoreDTO.contacts.trim() != ""'>" + |
| | | "and c.contacts like concat('%',#{pageComShopStoreDTO.contacts},'%') \n" + |
| | | " </if> " + |
| | | "<if test='pageComShopStoreDTO.account != null and pageComShopStoreDTO.account.trim() != ""'>" + |
| | | "and c.store_account = #{pageComShopStoreDTO.account} \n" + |
| | | " </if> " + |
| | | "<if test='pageComShopStoreDTO.name != null and pageComShopStoreDTO.name.trim() != ""'>" + |
| | | "and c.`name` like concat('%',#{pageComShopStoreDTO.name},'%') \n" + |
| | | " </if> " + |
| | | "<if test='pageComShopStoreDTO.deliveryType != null'>" + |
| | | "and c.delivery_type =#{pageComShopStoreDTO.deliveryType}\n" + |
| | | " </if> " + |
| | | "<if test='pageComShopStoreDTO.status != null'>" + |
| | | "and c.status =#{pageComShopStoreDTO.status} \n" + |
| | | " </if> " + |
| | | " </where>" + |
| | | " order by c.create_at desc" + |
| | | "</script>") |
| | | IPage<PageShopStoreVO> pageShopStore(Page page, @Param("pageComShopStoreDTO") PageComShopStoreDTO pageComShopStoreDTO); |
| | | |
| | | @Select("<script>" + |
| | | "select id,`name`,store_password,contacts,store_account,classify_id,logo,phone,delivery_type,remark,`status`," + |
| | | "sale,sale_volume,store_detail,create_at,store_describe from com_shop_store c" + |
| | | " <where>" + |
| | | " and c.delete_status=1 " + |
| | | "<if test='pageComShopStoreDTO.contacts != null and pageComShopStoreDTO.contacts.trim() != ""'>" + |
| | | "and c.contacts like concat('%',#{pageComShopStoreDTO.contacts},'%') \n" + |
| | | " </if> " + |
| | | "<if test='pageComShopStoreDTO.account != null and pageComShopStoreDTO.account.trim() != ""'>" + |
| | | "and c.store_account = #{pageComShopStoreDTO.account} \n" + |
| | | " </if> " + |
| | | "<if test='pageComShopStoreDTO.name != null and pageComShopStoreDTO.name.trim() != ""'>" + |
| | | "and c.`name` like concat('%',#{pageComShopStoreDTO.name},'%') \n" + |
| | | " </if> " + |
| | | "<if test='pageComShopStoreDTO.deliveryType != null'>" + |
| | | "and c.delivery_type =#{pageComShopStoreDTO.deliveryType}\n" + |
| | | " </if> " + |
| | | "<if test='pageComShopStoreDTO.status != null'>" + |
| | | "and c.status =#{pageComShopStoreDTO.status} \n" + |
| | | " </if> " + |
| | | " </where>" + |
| | | " order by c.create_at desc" + |
| | | "</script>") |
| | | IPage<PageShopStoreVO> pageShopStoreByAdmin(Page page, @Param("pageComShopStoreDTO") PageComShopStoreDTO pageComShopStoreDTO); |
| | | |
| | | @Select("delete from sys_user where user_id = #{sysUserId}") |
| | | void deleteSysUserBySysUserId(@Param("sysUserId") Long sysUserId); |
| | | |
| | | @Select("delete from sys_role where role_key = #{account}") |
| | | void deleteSysRoleByAccount(@Param("account") String account); |
| | | |
| | | @Select("select count(user_id) from sys_user where phone=#{phone}") |
| | | int reasonableUserByPhone(@Param("phone") String phone); |
| | | |
| | | @Select("select count(user_id) from sys_user where account=#{account} and type=5 ") |
| | | int reasonableUserByAccount(@Param("account") String account); |
| | | } |
| | |
| | | package com.panzhihua.service_community.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.panzhihua.common.model.vos.shop.ComShopUserAddressVO; |
| | | import com.panzhihua.service_community.model.dos.ComShopUserAddressDO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.apache.ibatis.annotations.Select; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @auther lyq |
| | |
| | | @Mapper |
| | | public interface ComShopUserAddressDAO extends BaseMapper<ComShopUserAddressDO> { |
| | | |
| | | @Select("select id,`name`,phone,province_code,province_name,city_code,city_name" + |
| | | ",district_code,district_name,detail_address,is_default " + |
| | | " from com_shop_user_address where delete_status = 2 and user_id = #{userId} order by create_at desc") |
| | | List<ComShopUserAddressVO> pageUserAddressList(Page page, @Param("userId") Long userId); |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.model.dos; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @auther llming |
| | | * @describe: 办事指南 |
| | | */ |
| | | @Data |
| | | @TableName(value = "com_act_work_guide") |
| | | public class ComActWorkGuideDO extends BaseDO implements Serializable { |
| | | /**自增 id*/ |
| | | @TableId(type = IdType.AUTO) |
| | | private Long id; |
| | | /** |
| | | * 办事指南标题 |
| | | */ |
| | | private String title; |
| | | /** |
| | | * 办事指南内容 |
| | | */ |
| | | private String content; |
| | | /** |
| | | * 办理时间 |
| | | */ |
| | | private String timeAt; |
| | | /** |
| | | * 办理地点 |
| | | */ |
| | | private String address; |
| | | /** |
| | | * 咨询电话 |
| | | */ |
| | | private String phone; |
| | | /** |
| | | * 经度 |
| | | */ |
| | | @TableField("`lon`") |
| | | private String lon; |
| | | /** |
| | | * 纬度 |
| | | */ |
| | | @TableField("`lat`") |
| | | private String lat; |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.model.dos; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @auther llming |
| | | * @describe: 办事指南材料 |
| | | */ |
| | | @Data |
| | | @TableName(value = "com_act_work_guide_material") |
| | | public class ComActWorkGuideMaterialDO implements Serializable { |
| | | /**自增 id*/ |
| | | @TableId(type = IdType.AUTO) |
| | | private Long id; |
| | | /** |
| | | * 申报材料名称 |
| | | */ |
| | | private String materialName; |
| | | /** |
| | | * 办事指南id |
| | | */ |
| | | private Long workGuideId; |
| | | } |
| | |
| | | * 社区id |
| | | */ |
| | | private Long communityId; |
| | | /** |
| | | * 申请提交人ID |
| | | */ |
| | | private Long submitUserId; |
| | | } |
| | |
| | | /** |
| | | * 商品名称 |
| | | */ |
| | | @TableField("`name`") |
| | | private String name; |
| | | |
| | | /** |
| | |
| | | /** |
| | | * 商品状态(1.出售中 2.已下架 3.回收站) |
| | | */ |
| | | @TableField("`status`") |
| | | private Integer status; |
| | | |
| | | /** |
| | |
| | | /** |
| | | * 商品排序 |
| | | */ |
| | | @TableField("`order`") |
| | | private Integer order; |
| | | |
| | | /** |
| | |
| | | @TableField(fill = FieldFill.UPDATE) |
| | | private Date updateAt; |
| | | |
| | | /** |
| | | * 商品状态(1.出售中 2.已下架 3.回收站) |
| | | */ |
| | | public interface status{ |
| | | int sell = 1; |
| | | int lower = 2; |
| | | int recovery = 3; |
| | | } |
| | | |
| | | /** |
| | | * 删除状态(1.未删除 2.已删除) |
| | | */ |
| | | public interface deleteStatus{ |
| | | int no = 1; |
| | | int yes = 2; |
| | | } |
| | | |
| | | /** |
| | | * 配送方式(1.商家配送 2.快递物流) |
| | | */ |
| | | public interface deliveryType{ |
| | | int store = 1; |
| | | int express = 2; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "ComShopGoodsDO{" + |
New file |
| | |
| | | package com.panzhihua.service_community.model.dos; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @program: springcloud_k8s_panzhihuazhihuishequ |
| | | * @description: 操作日志 |
| | | * @author: huang.hongfa weixin hhf9596 qq 959656820 |
| | | * @create: 2020-12-25 10:34 |
| | | **/ |
| | | @Data |
| | | @TableName("com_shop_oper_log") |
| | | public class ComShopOperLogDO implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 日志主键 |
| | | */ |
| | | @TableId(type = IdType.AUTO) |
| | | private Long operId; |
| | | |
| | | /** |
| | | * 模块标题 |
| | | */ |
| | | private String title; |
| | | |
| | | /** |
| | | * 业务类型(0其它 1新增 2修改 3删除) |
| | | */ |
| | | private Integer businessType; |
| | | |
| | | /** |
| | | * 方法名称 |
| | | */ |
| | | private String method; |
| | | |
| | | /** |
| | | * 请求方式 |
| | | */ |
| | | private String requestMethod; |
| | | |
| | | /** |
| | | * 操作类别(0其它 1后台用户 2手机端用户) |
| | | */ |
| | | private Integer operatorType; |
| | | |
| | | /** |
| | | * 操作人员 |
| | | */ |
| | | private String operName; |
| | | |
| | | /** |
| | | * 部门名称 |
| | | */ |
| | | private String deptName; |
| | | |
| | | /** |
| | | * 请求url |
| | | */ |
| | | private String operUrl; |
| | | |
| | | /** |
| | | * 主机地址 |
| | | */ |
| | | private String operIp; |
| | | |
| | | /** |
| | | * 操作地点 |
| | | */ |
| | | private String operLocation; |
| | | |
| | | /** |
| | | * 请求参数 |
| | | */ |
| | | private String operParam; |
| | | |
| | | /** |
| | | * 返回参数 |
| | | */ |
| | | private String jsonResult; |
| | | |
| | | /** |
| | | * 操作状态(0正常 1异常) |
| | | */ |
| | | private Integer status; |
| | | |
| | | /** |
| | | * 错误消息 |
| | | */ |
| | | private String errorMsg; |
| | | |
| | | /** |
| | | * 操作时间 |
| | | */ |
| | | private Date operTime; |
| | | |
| | | /** |
| | | * 操作社区id 0 标识运营后台 |
| | | */ |
| | | private Long communityId; |
| | | |
| | | /** |
| | | * 操作账户 |
| | | */ |
| | | private String account; |
| | | /** |
| | | * 操作用户ID |
| | | */ |
| | | private Long userId; |
| | | } |
| | |
| | | private String logisticsNo; |
| | | |
| | | /** |
| | | * 订单备注 |
| | | */ |
| | | private String remark; |
| | | |
| | | /** |
| | | * 发货时间 |
| | | */ |
| | | private Date deliveryTime; |
| | | |
| | | /** |
| | | * 下单时间 |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | |
| | | @TableField(fill = FieldFill.UPDATE) |
| | | private Date updateAt; |
| | | |
| | | /** |
| | | * 订单状态(1.待付款 2.代发货 3.待收货 4.待评价 5.已完成 6.已取消) |
| | | */ |
| | | public interface status{ |
| | | int dfk = 1; |
| | | int dfh = 2; |
| | | int dsh = 3; |
| | | int dpj = 4; |
| | | int ywc = 5; |
| | | int yqx = 6; |
| | | } |
| | | |
| | | /** |
| | | * 支付状态(1.未支付 2.已支付) |
| | | */ |
| | | public interface payStatus{ |
| | | int no = 1; |
| | | int yes = 2; |
| | | } |
| | | |
| | | /** |
| | | * 删除状态(1.未删除 2.已删除) |
| | | */ |
| | | public interface deleteStatus{ |
| | | int no = 1; |
| | | int yes = 2; |
| | | } |
| | | |
| | | /** |
| | | * 支付方式(1.微信支付) |
| | | */ |
| | | public interface payType{ |
| | | int wx = 1; |
| | | } |
| | | |
| | | /** |
| | | * 配送方式(1.商家配送 2.快递物流) |
| | | */ |
| | | public interface deliveryType{ |
| | | int store = 1; |
| | | int express = 2; |
| | | } |
| | | |
| | | /** |
| | | * 订单发货状态(1.未发货 2.已发货) |
| | | */ |
| | | public interface deliveryStatus{ |
| | | int no = 1; |
| | | int yes = 2; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "ComShopOrderDO{" + |
| | |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Date createAt; |
| | | |
| | | /** |
| | | * 操作类型(1.创建订单 2.取消订单 3.订单支付 4.订单发货 5.订单完成) |
| | | */ |
| | | public interface operationType{ |
| | | int create = 1; |
| | | int cancel = 2; |
| | | int pay = 3; |
| | | int deliver = 4; |
| | | int complete = 5; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "ComShopOrderOperateDO{" + |
| | |
| | | @TableField(fill = FieldFill.UPDATE) |
| | | private Date updateAt; |
| | | |
| | | /** |
| | | * 支付状态(1.未支付 2.已支付) |
| | | */ |
| | | public interface payStatus{ |
| | | int no = 1; |
| | | int yes = 2; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "ComShopOrderPayDO{" + |
| | |
| | | * 管理后台用户id |
| | | */ |
| | | private Long sysUserId; |
| | | |
| | | /** |
| | | * 店铺状态(1.启用 2.禁用) |
| | | */ |
| | | public interface status{ |
| | | int yes = 1; |
| | | int no = 2; |
| | | } |
| | | |
| | | /** |
| | | * 删除状态(1.未删除 2.已删除) |
| | | */ |
| | | public interface deleteStatus{ |
| | | int no = 1; |
| | | int yes = 2; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "ComShopStoreDO{" + |
| | |
| | | private Integer isDefault; |
| | | |
| | | /** |
| | | * 是否已删除(1.是 2.否) |
| | | */ |
| | | private Integer deleteStatus; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | |
| | | ", updateAt=" + updateAt + |
| | | "}"; |
| | | } |
| | | |
| | | /** |
| | | * 是否是默认地址(1.是 2.否) |
| | | */ |
| | | public interface isDefault{ |
| | | int yes = 1; |
| | | int no = 2; |
| | | } |
| | | } |
| | |
| | | * @return 代办事件集合 |
| | | */ |
| | | List<TodoEventsVO> selectNeedToDo(Long communityId, Long userId); |
| | | |
| | | /** |
| | | * 删除微心愿 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | R deleteMicroWish(Long id); |
| | | |
| | | |
| | | /** |
| | | * 定时任务刷新微心愿状态 |
| | | * @return |
| | | */ |
| | | R timedTaskActMicroWishAll(); |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.service; |
| | | |
| | | import com.panzhihua.common.model.dtos.community.PageActWorkGuideDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.ComActWorkGuideVO; |
| | | |
| | | /** |
| | | * @auther llming |
| | | * @describe 办事指南 |
| | | */ |
| | | public interface ComActWorkGuideService { |
| | | /** |
| | | * 办事指南_新增 |
| | | * @param workGuideVO 办事指南信息 |
| | | * @return 新增结果 |
| | | */ |
| | | R addWorkGuide(ComActWorkGuideVO workGuideVO,Long userId); |
| | | /** |
| | | * 办事指南_编辑 |
| | | * @param workGuideVO 编辑内容 |
| | | * @return 编辑结果 |
| | | */ |
| | | R editWorkGuide(ComActWorkGuideVO workGuideVO, Long userId); |
| | | /** |
| | | * 办事指南_详情 |
| | | * @param workGuideId 办事指南id |
| | | * @return 社区详情 |
| | | */ |
| | | R detailWorkGuide(Long workGuideId); |
| | | /** |
| | | * 办事指南_分页 |
| | | * @param pageActWorkGuideDTO 查询参数 |
| | | * @return 分页集合 |
| | | */ |
| | | R pageWorkGuide(PageActWorkGuideDTO pageActWorkGuideDTO); |
| | | /** |
| | | * 办事指南_删除 |
| | | * @param workGuideId 办事指南id |
| | | * @return 删除结果 |
| | | */ |
| | | R delectWorkGuide(Long workGuideId); |
| | | } |
| | |
| | | |
| | | import com.panzhihua.common.model.dtos.community.ComMngPopulationDTO; |
| | | import com.panzhihua.common.model.dtos.community.ComMngPopulationTagDTO; |
| | | import com.panzhihua.common.model.dtos.user.PageInputUserDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.ComMngPopulationServeExcelVO; |
| | | import com.panzhihua.common.model.vos.community.ComMngPopulationVO; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import com.panzhihua.common.model.vos.community.EditComMngPopulationVO; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | * @return |
| | | */ |
| | | R listSavePopulation(List<ComMngPopulationServeExcelVO> list, Long communityId); |
| | | |
| | | /** |
| | | * 确认导入实有人口(有则更新,无则新建) |
| | | * @param list 用户信息 |
| | | * @param communityId 社区id |
| | | * @return 导入结果 |
| | | */ |
| | | R listSavePopulationConfirm(List<ComMngPopulationServeExcelVO> list, Long communityId); |
| | | /** |
| | | * 根据实有人口id修改用户标签 |
| | | * @param populationTagDTO 请求参数 |
| | |
| | | */ |
| | | R getPopulationLists(List<Long> Ids); |
| | | |
| | | /** |
| | | * 编辑实有人口 |
| | | * @param editComMngPopulationVO |
| | | * @param communityId |
| | | * @return |
| | | */ |
| | | R editPopulation(EditComMngPopulationVO editComMngPopulationVO, Long communityId); |
| | | |
| | | /** |
| | | * 分页查询特殊群体 |
| | | * @param pageInputUserDTO 请求参数 |
| | | * @return 特殊群体列表 |
| | | */ |
| | | R specialInputUser(PageInputUserDTO pageInputUserDTO); |
| | | |
| | | /** |
| | | * 删除特殊群体人员 |
| | | * @param id 特殊群体id |
| | | * @return 删除结果 |
| | | */ |
| | | R deleteSpecialInputUser(Long id); |
| | | |
| | | /** |
| | | * 查询实有人口电子档信息 |
| | | * @param populationId 实有人口id |
| | | * @return 实有人口电子档信息 |
| | | */ |
| | | R electronicArchivesPopulation(Long populationId); |
| | | } |
| | |
| | | */ |
| | | List<TodoEventsVO> selectNeedToDo(Long communityId, Long userId); |
| | | |
| | | /** |
| | | * 获取志愿者详情 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | R getVolunteerById(Long id); |
| | | } |
| | |
| | | package com.panzhihua.service_community.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.panzhihua.common.model.dtos.shop.ComShopCartDTO; |
| | | import com.panzhihua.common.model.dtos.shop.ComShopEditNubCartDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.service_community.model.dos.ComShopCartDO; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @auther lyq |
| | |
| | | */ |
| | | public interface ComShopCartService extends IService<ComShopCartDO> { |
| | | |
| | | /** |
| | | * 根据用户id查询购物车列表信息 |
| | | * @param userId 用户id |
| | | * @return 购物车列表信息 |
| | | */ |
| | | R shopCartList(Long userId); |
| | | |
| | | /** |
| | | * 购物车添加 |
| | | * @param comShopCartDTO 请求参数 |
| | | * @return 添加结果 |
| | | */ |
| | | R shopAddCart(ComShopCartDTO comShopCartDTO); |
| | | |
| | | /** |
| | | * 购物车内商品数量修改 |
| | | * @param shopEditNubCartDTO 请求参数 |
| | | * @return 修改结果 |
| | | */ |
| | | R shopEditNubCart(ComShopEditNubCartDTO shopEditNubCartDTO); |
| | | |
| | | /** |
| | | * 删除购物车记录 |
| | | * @param Ids 购物车id集合 |
| | | * @return 删除结果 |
| | | */ |
| | | R shopDelCart(List<Long> Ids); |
| | | |
| | | /** |
| | | * 查询用户购物车商品数量 |
| | | * @param userId 用户id |
| | | * @return 用户购物车商品数量 |
| | | */ |
| | | R shopCartUserTotal(Long userId); |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | package com.panzhihua.service_community.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.panzhihua.common.model.dtos.shop.ComShopGoodsDTO; |
| | | import com.panzhihua.common.model.dtos.shop.PageComShopGoodsDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.shop.ShopGoodsVO; |
| | | import com.panzhihua.common.model.vos.shop.AddShopGoodsVO; |
| | | import com.panzhihua.service_community.model.dos.ComShopGoodsDO; |
| | | |
| | | /** |
| | |
| | | public interface ComShopGoodsService extends IService<ComShopGoodsDO> { |
| | | |
| | | /** |
| | | * 分页查询商品列表 |
| | | * @param comShopGoodsDTO 请求参数 |
| | | * @return 商品列表 |
| | | */ |
| | | R pageShopGoods(ComShopGoodsDTO comShopGoodsDTO); |
| | | |
| | | /** |
| | | * 根据商品id查询商品信息 |
| | | * @param goodsId 商品id |
| | | * @return 商品信息 |
| | | */ |
| | | R shopGoodsDetail(Long goodsId); |
| | | |
| | | /** |
| | | * 添加商品 |
| | | * @param shopGoodsVO |
| | | * @param addShopGoodsVO |
| | | * @return |
| | | */ |
| | | R saveShopGoods(ShopGoodsVO shopGoodsVO); |
| | | R saveShopGoods(AddShopGoodsVO addShopGoodsVO); |
| | | |
| | | /** |
| | | * 商品列表-分页查询 |
| | | * @param pageComShopGoodsDTO 查询参数 |
| | | * @return ComShopStoreVO |
| | | * @return PageShopStoreVO |
| | | */ |
| | | R pageStoreList(PageComShopGoodsDTO pageComShopGoodsDTO); |
| | | |
| | | |
| | | R pageGoodsList(PageComShopGoodsDTO pageComShopGoodsDTO); |
| | | |
| | | /** |
| | | * 编辑商品、上架、下架 |
| | | * 编辑商品 |
| | | * |
| | | * @param id 商铺ID |
| | | * @param shopGoodsVO |
| | | * @param addShopGoodsVO |
| | | * @return |
| | | */ |
| | | R editShopGoods(Long id, ShopGoodsVO shopGoodsVO); |
| | | R editShopGoods(Long id, AddShopGoodsVO addShopGoodsVO); |
| | | |
| | | /** |
| | | * 删除商品 |
| | |
| | | * @return |
| | | */ |
| | | R deleteShopGoods(Long[] id); |
| | | |
| | | /** |
| | | * 修改商品状态 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | R changeStatus(Long id,Integer status); |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.panzhihua.common.model.dtos.PageDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.shop.ShopOperLogVO; |
| | | import com.panzhihua.service_community.model.dos.ComShopOperLogDO; |
| | | import com.panzhihua.service_community.model.dos.ComShopUserAddressDO; |
| | | |
| | | /** |
| | | * @author cedoo |
| | | * @create 2021-4-16 10:49:12 |
| | | * @describe 商城后台操作日志 |
| | | */ |
| | | public interface ComShopOperLogService extends IService<ComShopOperLogDO> { |
| | | /** |
| | | * 通过VO添加日志 |
| | | * @param shopOperlog 商城后台日志VO |
| | | * @return |
| | | */ |
| | | R saveLog(ShopOperLogVO shopOperlog); |
| | | |
| | | /** |
| | | * 查询商城后台操作日志 |
| | | * @param pageDTO |
| | | * @return |
| | | */ |
| | | R pageShopOperLog(PageDTO pageDTO); |
| | | } |
| | |
| | | package com.panzhihua.service_community.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.panzhihua.common.model.dtos.shop.*; |
| | | import com.panzhihua.common.model.dtos.shop.*; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.service_community.model.dos.ComShopOrderDO; |
| | | |
| | | /** |
| | |
| | | */ |
| | | public interface ComShopOrderService extends IService<ComShopOrderDO> { |
| | | |
| | | /** |
| | | * 分页搜索订单记录 |
| | | * @param pageComShopOrderSearchDTO 分页数据 |
| | | * @return 分页订单 |
| | | */ |
| | | R pageShopOrder(PageComShopOrderSearchDTO pageComShopOrderSearchDTO); |
| | | /** |
| | | * 订单预览 |
| | | * @param orderPreviewDTO 请求参数 |
| | | * @return 订单预览数据 |
| | | */ |
| | | R orderPreview(ComShopOrderPreviewDTO orderPreviewDTO); |
| | | |
| | | /** |
| | | * 创建订单 |
| | | * @param orderCreateDTO 创建订单请求参数 |
| | | * @return 创建结果 |
| | | */ |
| | | R orderCreate(ComShopOrderCreateDTO orderCreateDTO); |
| | | |
| | | /** |
| | | * 分页查询用户订单列表 |
| | | * @param comOrderListDTO 请求参数 |
| | | * @return 查询结果 |
| | | */ |
| | | R pageOrderList(PageComOrderListDTO comOrderListDTO); |
| | | |
| | | /** |
| | | * 根据订单id查询订单详情 |
| | | * @param orderId 订单id |
| | | * @return 订单详情 |
| | | */ |
| | | R orderDetail(Long orderId); |
| | | |
| | | /** |
| | | * 根据订单id取消订单 |
| | | * @param comShopOrderQueryDTO 订单信息 |
| | | * @return 取消结果 |
| | | */ |
| | | R orderCancel(ComShopOrderQueryDTO comShopOrderQueryDTO); |
| | | |
| | | /** |
| | | * 根据订单id删除订单 |
| | | * @param orderId 订单id |
| | | * @return 删除结果 |
| | | */ |
| | | R orderDelete(Long orderId); |
| | | |
| | | /** |
| | | * 根据订单id确认收货 |
| | | * @param orderId 订单id |
| | | * @param phone 手机号 |
| | | * @return 确认结果 |
| | | */ |
| | | R orderConfirm(Long orderId, String phone); |
| | | |
| | | /** |
| | | * 统计用户订单数量 |
| | | * @param userId 用户id |
| | | * @return 统计结果 |
| | | */ |
| | | R orderStatistics(Long userId); |
| | | |
| | | /** |
| | | * 商家资金的订单详情 |
| | | * @param id 订单id |
| | | * @return |
| | | */ |
| | | R capitalDetailByStore(Long id); |
| | | |
| | | /** |
| | | * 订单发货 |
| | | * @param orderShipDTO 订单发货信息 |
| | | * @return 发货结果 |
| | | */ |
| | | R shipOrder(ComShopOrderShipDTO orderShipDTO); |
| | | |
| | | /** |
| | | * 订单配送 |
| | | * @param orderDeliverDTO 订单信息 |
| | | * @return 配送结果 |
| | | */ |
| | | R deliverOrder(ComShopOrderDeliverDTO orderDeliverDTO); |
| | | |
| | | /** |
| | | * 订单完成配送 |
| | | * @param orderDeliverDTO 订单信息 |
| | | * @return 完成配送结果 |
| | | */ |
| | | R finishDeliverOrder(ComShopOrderDeliverDTO orderDeliverDTO); |
| | | |
| | | /** |
| | | * 获取订单导出数据 |
| | | * @param comShopOrderExportDTO 订单导出参数 |
| | | * @return 订单数据 |
| | | */ |
| | | R shopOrderExportData(ComShopOrderExportDTO comShopOrderExportDTO); |
| | | |
| | | /** |
| | | * 获取资金导出数据 |
| | | * @param comShopFundsExportDTO 资金导出参数 |
| | | * @return 资金数据 |
| | | */ |
| | | R shopOrderFundsExportData(ComShopFundsExportDTO comShopFundsExportDTO); |
| | | |
| | | /** |
| | | * 获取用户资金信息 |
| | | * @param userId 用户ID |
| | | * @return 统计结果 |
| | | */ |
| | | R getFundsStat(Long userId); |
| | | |
| | | /** |
| | | * 获取分页 资金订单数据 |
| | | * @param pageComShopFundsSearchDTO 资金导出参数 |
| | | * @return 资金订单数据 |
| | | */ |
| | | R pageShopFunds(PageComShopFundsSearchDTO pageComShopFundsSearchDTO); |
| | | |
| | | /** |
| | | * 微信支付订单回调 |
| | | * @param wxPayNotifyOrderDTO 订单支付回调参数 |
| | | */ |
| | | void wxOrderPayNotify(WxPayNotifyOrderDTO wxPayNotifyOrderDTO); |
| | | |
| | | /** |
| | | * 用户点击去支付 |
| | | * @param orderPayDTO 请求参数 |
| | | * @return 返回支付对象 |
| | | */ |
| | | R wxPay(OrderPayDTO orderPayDTO); |
| | | } |
| | |
| | | package com.panzhihua.service_community.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.panzhihua.common.model.dtos.shop.PageComShopGoodsDTO; |
| | | import com.panzhihua.common.model.dtos.shop.PageComShopStoreDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.shop.ShopGoodsVO; |
| | | import com.panzhihua.common.model.vos.shop.ShopStoreVO; |
| | | import com.panzhihua.service_community.model.dos.ComShopStoreDO; |
| | | |
| | |
| | | /** |
| | | * 店铺列表-分页查询 |
| | | * @param pageComShopStoreDTO 查询参数 |
| | | * @return ComShopStoreVO |
| | | * @return PageShopStoreVO |
| | | */ |
| | | R pageStoreList(PageComShopStoreDTO pageComShopStoreDTO); |
| | | |
| | | /** |
| | | * 根据店铺id查询店铺详情 |
| | | * @param comShopStoreDTO 请求参数 |
| | | * @return 店铺详情 |
| | | */ |
| | | R shopStoreDetail(PageComShopStoreDTO comShopStoreDTO); |
| | | |
| | | /** |
| | | * 保存店铺 |
| | |
| | | */ |
| | | R saveStore(ShopStoreVO storeVO); |
| | | |
| | | /** |
| | | * 新增店铺 |
| | | * @param storeVO 请求参数 |
| | | * @return 新增结果 |
| | | */ |
| | | R addStore(ShopStoreVO storeVO); |
| | | |
| | | /** |
| | | * 编辑店铺、启用、禁用 |
| | |
| | | * @return |
| | | */ |
| | | R getOneInfo(Long id); |
| | | |
| | | /** |
| | | * 获取用户商铺信息 |
| | | * @param userId 用户ID |
| | | * @return |
| | | */ |
| | | R getUserStoreInfo(Long userId); |
| | | /** |
| | | * 获取用户商铺信息 |
| | | * @param account 用户账号 |
| | | * @return |
| | | */ |
| | | R getUserStoreInfo(String account); |
| | | } |
| | |
| | | package com.panzhihua.service_community.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.panzhihua.common.model.dtos.shop.ComShopAddressDTO; |
| | | import com.panzhihua.common.model.dtos.shop.PageComShopAddressDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.service_community.model.dos.ComShopUserAddressDO; |
| | | |
| | | /** |
| | |
| | | */ |
| | | public interface ComShopUserAddressService extends IService<ComShopUserAddressDO> { |
| | | |
| | | /** |
| | | * 查询用户收获地址列表 |
| | | * @param comShopAddressDTO 请求参数 |
| | | * @return 用户收货地址列表 |
| | | */ |
| | | R shopUserAddressList(PageComShopAddressDTO comShopAddressDTO); |
| | | |
| | | /** |
| | | * 用户添加书货地址 |
| | | * @param comShopAddressDTO 请求参数 |
| | | * @return 添加结果 |
| | | */ |
| | | R shopAddUserAddress(ComShopAddressDTO comShopAddressDTO); |
| | | |
| | | /** |
| | | * 用户修改收货地址 |
| | | * @param comShopAddressDTO 请求参数 |
| | | * @return 修改结果 |
| | | */ |
| | | R shopEditUserAddress(ComShopAddressDTO comShopAddressDTO); |
| | | |
| | | /** |
| | | * 用户删除收货地址 |
| | | * @param addressId 收货地址id |
| | | * @return 删除结果 |
| | | */ |
| | | R shopDelUserAddress(Long addressId); |
| | | |
| | | } |
| | |
| | | ComActActivityDO comActActivityDO=new ComActActivityDO(); |
| | | BeanUtils.copyProperties(comActActivityVO,comActActivityDO); |
| | | Integer status = comActActivityVO.getStatus(); |
| | | Date now = new Date(); |
| | | if (status.intValue()!=1) { |
| | | comActActivityDO.setPublishAt(new Date());//发布时间 |
| | | comActActivityDO.setPublishAt(now);//发布时间 |
| | | } |
| | | //如果发布时间大于现在时间状态改为进行中 |
| | | /*if(now.getTime()<comActActivityVO.getBeginAt().getTime()){ |
| | | comActActivityDO.setStatus(3); |
| | | }*/ |
| | | //报名结束时间大于当前时间则设置为“进行中” |
| | | if(comActActivityVO.getSignUpEnd()!=null && now.getTime()<comActActivityVO.getSignUpEnd().getTime()){ |
| | | comActActivityDO.setStatus(4); |
| | | } |
| | | |
| | | boolean save = this.save(comActActivityDO); |
| | | if(!save){ |
| | | return R.fail(); |
| | |
| | | public R putActivity(ComActActivityVO comActActivityVO) { |
| | | ComActActivityDO comActActivityDO=new ComActActivityDO(); |
| | | BeanUtils.copyProperties(comActActivityVO,comActActivityDO); |
| | | |
| | | //结束时间大于当前时间则设置为“进行中” |
| | | Date now = new Date(); |
| | | if(comActActivityVO.getSignUpEnd()!=null && now.getTime()<comActActivityVO.getSignUpEnd().getTime()){ |
| | | comActActivityDO.setStatus(4); |
| | | } |
| | | boolean b = this.updateById(comActActivityDO); |
| | | if (b) { |
| | | return R.ok(); |
| | |
| | | indexDataVO.setCommunityActivitiesVOS(communityActivitiesVOS); |
| | | return R.ok(indexDataVO); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 获取最近七天的时间 |
| | |
| | | package com.panzhihua.service_community.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | |
| | | import com.panzhihua.service_community.model.dos.ComActMicroWishDO; |
| | | import com.panzhihua.service_community.model.dos.ComActMicroWishUserDO; |
| | | import com.panzhihua.service_community.service.ComActMicroWishService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.ObjectUtils; |
| | | |
| | |
| | | * @create: 2020-12-07 14:34 |
| | | **/ |
| | | @Service |
| | | @Slf4j |
| | | public class ComActMicroWishServiceImpl extends ServiceImpl<ComActMicroWishDAO, ComActMicroWishDO> implements ComActMicroWishService { |
| | | @Resource |
| | | private ComActMicroWishDAO comActMicroWishDAO; |
| | |
| | | if (!ObjectUtils.isEmpty(records)) { |
| | | records.forEach(comActMicroWishVO1 -> { |
| | | Long id = comActMicroWishVO1.getId(); |
| | | ComActMicroWishUserDO comActMicroWishUserDO = comActMicroWishUserDAO.selectOne(new QueryWrapper<ComActMicroWishUserDO>().lambda().eq(ComActMicroWishUserDO::getMicroWishId, id).eq(ComActMicroWishUserDO::getUserId, userId)); |
| | | ComActMicroWishUserDO comActMicroWishUserDO = comActMicroWishUserDAO.selectOne(new QueryWrapper<ComActMicroWishUserDO>().lambda().eq(ComActMicroWishUserDO::getMicroWishId, id) |
| | | .eq(ComActMicroWishUserDO::getUserId, userId)); |
| | | if (ObjectUtils.isEmpty(comActMicroWishUserDO)) { |
| | | comActMicroWishVO1.setHaveGiveThumbsUp(0); |
| | | } else { |
| | |
| | | return todoEventsVOS; |
| | | } |
| | | |
| | | @Override |
| | | public R deleteMicroWish(Long id) { |
| | | ComActMicroWishDO comActMicroWishDO = comActMicroWishDAO.selectById(id); |
| | | if(comActMicroWishDO==null){ |
| | | return R.fail("id有误!"); |
| | | } |
| | | comActMicroWishDAO.deleteById(id); |
| | | comActMicroWishUserDAO.delete(new LambdaQueryWrapper<ComActMicroWishUserDO>().eq(ComActMicroWishUserDO::getMicroWishId,id)); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @Override |
| | | public R timedTaskActMicroWishAll() { |
| | | int num=comActMicroWishDAO.updateStatusAutoConfirm(); |
| | | log.info("定时任务--修改待自动确认微心愿状态数量【{}】",num); |
| | | return R.ok(); |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.panzhihua.common.model.dtos.community.PageActWorkGuideDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.ComActWorkGuideMaterialVO; |
| | | import com.panzhihua.common.model.vos.community.ComActWorkGuideVO; |
| | | import com.panzhihua.common.utlis.DifferentLongListUtil; |
| | | import com.panzhihua.service_community.dao.ComActWorkGuideDAO; |
| | | import com.panzhihua.service_community.dao.ComActWorkGuideMaterialDAO; |
| | | import com.panzhihua.service_community.model.dos.ComActWorkGuideDO; |
| | | import com.panzhihua.service_community.model.dos.ComActWorkGuideMaterialDO; |
| | | import com.panzhihua.service_community.service.ComActWorkGuideService; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * @auther llming |
| | | * @describe 办事指南 |
| | | */ |
| | | @Service |
| | | public class ComActWorkGuideServiceImpl extends ServiceImpl<ComActWorkGuideDAO, ComActWorkGuideDO> implements ComActWorkGuideService { |
| | | @Resource |
| | | ComActWorkGuideMaterialDAO workGuideMaterialDAO; |
| | | |
| | | @Override |
| | | public R addWorkGuide(ComActWorkGuideVO workGuideVO, Long userId) { |
| | | ComActWorkGuideDO comActWorkGuideDO = new ComActWorkGuideDO(); |
| | | BeanUtils.copyProperties(workGuideVO, comActWorkGuideDO); |
| | | comActWorkGuideDO.setCreateBy(userId); |
| | | this.baseMapper.insert(comActWorkGuideDO); |
| | | //保存办事指南材料 |
| | | workGuideVO.getMaterials().forEach(material -> { |
| | | ComActWorkGuideMaterialDO workGuideMaterialDO = new ComActWorkGuideMaterialDO(); |
| | | workGuideMaterialDO.setMaterialName(material.getMaterialName()); |
| | | workGuideMaterialDO.setWorkGuideId(comActWorkGuideDO.getId()); |
| | | workGuideMaterialDAO.insert(workGuideMaterialDO); |
| | | }); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @Override |
| | | public R editWorkGuide(ComActWorkGuideVO workGuideVO, Long userId) { |
| | | if (workGuideVO.getId() == 0L) { |
| | | return R.fail("Id有误!"); |
| | | } |
| | | ComActWorkGuideDO workGuideDO = this.baseMapper.selectById(workGuideVO.getId()); |
| | | if (workGuideDO == null) { |
| | | return R.fail("Id有误!"); |
| | | } |
| | | BeanUtils.copyProperties(workGuideVO, workGuideDO); |
| | | workGuideDO.setUpdateBy(userId); |
| | | this.baseMapper.updateById(workGuideDO); |
| | | if (workGuideVO.getMaterials().size() == 0) {//若编辑材料为null,执行删除操作 |
| | | workGuideMaterialDAO.delete(new LambdaQueryWrapper<ComActWorkGuideMaterialDO>() |
| | | .eq(ComActWorkGuideMaterialDO::getWorkGuideId, workGuideVO.getId())); |
| | | } else {//若材料不为空,但是少了数据条数,也要执行删除 |
| | | List<ComActWorkGuideMaterialDO> workGuideMaterialDOS = workGuideMaterialDAO.selectList(new LambdaQueryWrapper<ComActWorkGuideMaterialDO>() |
| | | .eq(ComActWorkGuideMaterialDO::getWorkGuideId, workGuideVO.getId())); |
| | | //1、筛选vo里面和db里,需要删除的材料数据 |
| | | List<Long> voMaterialIds = workGuideVO.getMaterials().stream() |
| | | .filter(materialVo -> materialVo.getId() != null) |
| | | .map(ComActWorkGuideMaterialVO::getId) |
| | | .collect(Collectors.toList()); |
| | | List<Long> deleteMaterialIds = workGuideMaterialDOS.stream() |
| | | .filter(workGuideMaterialDO -> !voMaterialIds.contains(workGuideMaterialDO.getId())) |
| | | .map(ComActWorkGuideMaterialDO::getId) |
| | | .collect(Collectors.toList()); |
| | | if (deleteMaterialIds.size() != 0) { |
| | | workGuideMaterialDAO.deleteBatchIds(deleteMaterialIds); |
| | | } |
| | | workGuideVO.getMaterials().forEach(materialsVO -> { |
| | | if (materialsVO.getId() != null && materialsVO.getId() != 0L) { |
| | | ComActWorkGuideMaterialDO workGuideMaterialDO1 = workGuideMaterialDOS.stream().filter(workGuideMaterialDO -> workGuideMaterialDO.getId() |
| | | .equals(materialsVO.getId())).findFirst().orElse(null); |
| | | if (workGuideMaterialDO1 != null) {//2、如果db有,执行编辑 |
| | | workGuideMaterialDO1.setMaterialName(materialsVO.getMaterialName()); |
| | | workGuideMaterialDAO.updateById(workGuideMaterialDO1); |
| | | } |
| | | } else {//3、如果db没有,执行新增 |
| | | ComActWorkGuideMaterialDO newWorkGuideMaterialDO = new ComActWorkGuideMaterialDO(); |
| | | newWorkGuideMaterialDO.setMaterialName(materialsVO.getMaterialName()); |
| | | newWorkGuideMaterialDO.setWorkGuideId(workGuideDO.getId()); |
| | | workGuideMaterialDAO.insert(newWorkGuideMaterialDO); |
| | | } |
| | | }); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | @Override |
| | | public R detailWorkGuide(Long workGuideId) { |
| | | ComActWorkGuideDO workGuideDO = this.baseMapper.selectById(workGuideId); |
| | | if (workGuideDO == null) { |
| | | return R.fail("Id有误!"); |
| | | } |
| | | ComActWorkGuideVO vo = new ComActWorkGuideVO(); |
| | | BeanUtils.copyProperties(workGuideDO, vo); |
| | | List<ComActWorkGuideMaterialDO> workGuideMaterialDOS = workGuideMaterialDAO.selectList(new LambdaQueryWrapper<ComActWorkGuideMaterialDO>() |
| | | .eq(ComActWorkGuideMaterialDO::getWorkGuideId, workGuideId)); |
| | | workGuideMaterialDOS.forEach(workGuideMaterialDO -> { |
| | | ComActWorkGuideMaterialVO workGuideMaterialVO = new ComActWorkGuideMaterialVO(); |
| | | workGuideMaterialVO.setId(workGuideMaterialDO.getId()); |
| | | workGuideMaterialVO.setMaterialName(workGuideMaterialDO.getMaterialName()); |
| | | vo.getMaterials().add(workGuideMaterialVO); |
| | | }); |
| | | return R.ok(vo); |
| | | } |
| | | |
| | | @Override |
| | | public R pageWorkGuide(PageActWorkGuideDTO pageActWorkGuideDTO) { |
| | | Page page = new Page<>(); |
| | | Long pageNum = pageActWorkGuideDTO.getPageNum(); |
| | | Long pageSize = pageActWorkGuideDTO.getPageSize(); |
| | | if (null == pageNum || 0 == pageNum) { |
| | | pageNum = 1l; |
| | | } |
| | | if (null == pageSize || 0 == pageSize) { |
| | | pageSize = 10l; |
| | | } |
| | | page.setSize(pageSize); |
| | | page.setCurrent(pageNum); |
| | | IPage<ComActWorkGuideVO> iPage = this.baseMapper.pageWorkGuide(page, pageActWorkGuideDTO); |
| | | return R.ok(iPage); |
| | | } |
| | | |
| | | @Override |
| | | public R delectWorkGuide(Long workGuideId) { |
| | | this.baseMapper.deleteById(workGuideId); |
| | | workGuideMaterialDAO.delete(new LambdaQueryWrapper<ComActWorkGuideMaterialDO>() |
| | | .eq(ComActWorkGuideMaterialDO::getWorkGuideId, workGuideId)); |
| | | return R.ok(); |
| | | } |
| | | } |
| | |
| | | package com.panzhihua.service_community.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | |
| | | import com.panzhihua.common.exceptions.ServiceException; |
| | | import com.panzhihua.common.model.dtos.community.ComMngPopulationDTO; |
| | | import com.panzhihua.common.model.dtos.community.ComMngPopulationTagDTO; |
| | | import com.panzhihua.common.model.dtos.user.PageInputUserDTO; |
| | | import com.panzhihua.common.model.helper.AESUtil; |
| | | import com.panzhihua.common.model.dtos.community.PageComActDTO; |
| | | import com.panzhihua.common.model.helper.AESUtil; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.*; |
| | | import com.panzhihua.common.model.vos.user.ComHouseMemberVo; |
| | | import com.panzhihua.common.model.vos.user.ComMngFamilyInfoVO; |
| | | import com.panzhihua.service_community.dao.ComActActivityDAO; |
| | | import com.panzhihua.common.model.vos.user.InputUserInfoVO; |
| | | import com.panzhihua.common.model.vos.user.UserElectronicFileVO; |
| | | import com.panzhihua.service_community.dao.ComActDAO; |
| | | import com.panzhihua.service_community.dao.ComActVillageDAO; |
| | | import com.panzhihua.service_community.dao.ComMngPopulationDAO; |
| | | import com.panzhihua.service_community.model.dos.ComActActivityDO; |
| | | import com.panzhihua.service_community.model.dos.ComActDO; |
| | | import com.panzhihua.service_community.model.dos.ComMngPopulationDO; |
| | | import com.panzhihua.service_community.model.dos.ComMngVillageDO; |
| | | import com.panzhihua.service_community.service.ComMngPopulationService; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.ObjectUtils; |
| | | import org.springframework.util.StringUtils; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.crypto.BadPaddingException; |
| | | import javax.crypto.IllegalBlockSizeException; |
| | | import javax.crypto.NoSuchPaddingException; |
| | | import java.io.UnsupportedEncodingException; |
| | | import java.security.InvalidKeyException; |
| | | import java.security.NoSuchAlgorithmException; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * 实有人口Service实现类 |
| | |
| | | private ComActDAO comActDAO; |
| | | @Resource |
| | | private ComActVillageDAO comActVillageDAO; |
| | | @Value("${domain.aesKey:}") |
| | | private String aesKey; |
| | | |
| | | |
| | | /** |
| | |
| | | public R detailPopulation(Long populationId) { |
| | | ComMngPopulationDO comMngPopulationDO = populationDAO.selectById(populationId); |
| | | if (ObjectUtils.isEmpty(comMngPopulationDO)) { |
| | | return R.fail(); |
| | | return R.fail("用户信息不存在"); |
| | | } |
| | | ComMngPopulationVO comMngPopulationVO = new ComMngPopulationVO(); |
| | | BeanUtils.copyProperties(comMngPopulationDO, comMngPopulationVO); |
| | | |
| | | //查询房屋成员信息 |
| | | //查询户主关系信息 |
| | | List<ComHouseMemberVo> comMngFamilyInfoVOS = populationDAO.listHouseMermberByUserId(comMngPopulationDO); |
| | | if (!comMngFamilyInfoVOS.isEmpty()) { |
| | | comMngPopulationVO.setComMngFamilyInfoVOS(comMngFamilyInfoVOS); |
| | | } |
| | | |
| | | //查询当前用户电子档信息 |
| | | if(!StringUtils.isEmpty(comMngPopulationDO.getCardNo())){ |
| | | UserElectronicFileVO electronicFileVO = populationDAO.getSysUserElectronicFile(comMngPopulationDO.getCardNo()); |
| | | if(electronicFileVO != null){ |
| | | comMngPopulationVO.setUserElectronicFileVO(electronicFileVO); |
| | | //查询家庭成员信息 |
| | | List<ComMngFamilyInfoVO> familyInfoVOList = populationDAO.listFamilyByUserId(electronicFileVO.getUserId()); |
| | | if(!familyInfoVOList.isEmpty()){ |
| | | comMngPopulationVO.setFamilyInfoVOList(familyInfoVOList); |
| | | } |
| | | } |
| | | } |
| | | return R.ok(comMngPopulationVO); |
| | | } |
| | |
| | | |
| | | @Override |
| | | public R listSavePopulation(List<ComMngPopulationServeExcelVO> list, Long communityId) { |
| | | List<ComMngPopulationImportErrorVO> populationImportErrorVOList = new ArrayList<>(); |
| | | List<ComMngPopulationDO> comMngPopulationDOS = populationDAO.selectList(new QueryWrapper<ComMngPopulationDO>().lambda().eq(ComMngPopulationDO::getActId, communityId)); |
| | | //查询该社区所有(实有房屋)小区 |
| | | // List<ComMngVillageDO> villageDOList = comActVillageDAO.selectList(new QueryWrapper<ComMngVillageDO>().lambda().eq(ComMngVillageDO::getCommunityId, communityId)); |
| | | ComActDO comActDO = comActDAO.selectById(communityId); |
| | | ArrayList<ComMngPopulationDO> populationDOList = Lists.newArrayList(); |
| | | int index = 2; |
| | | for (ComMngPopulationServeExcelVO vo : list) { |
| | | //判断DB和exel数据重复判断 |
| | | boolean result = comMngPopulationDOS.stream().anyMatch(population -> population.getCardNo().equals(vo.getCardNo())); |
| | | if (result) { |
| | | ComMngPopulationImportErrorVO importErrorVO = new ComMngPopulationImportErrorVO(); |
| | | importErrorVO.setErrorMsg("导入实有人口已存在(" + vo.getCardNo() + ")"); |
| | | importErrorVO.setErrorPosition("第" + index + "行,第2列"); |
| | | populationImportErrorVOList.add(importErrorVO); |
| | | index++; |
| | | continue; |
| | | // return R.fail(501,"导入实有人口已存在(" + vo.getCardNo() + ")"); |
| | | } |
| | | |
| | | ComMngPopulationDO comMngPopulationDO = new ComMngPopulationDO(); |
| | | //查询街路巷是否存在 |
| | | ComMngVillageDO comMngVillageDO = comActVillageDAO.selectOne(new QueryWrapper<ComMngVillageDO>().eq("alley",vo.getRoad()).eq("house_num",vo.getDoorNo()).eq("community_id",communityId)); |
| | | // ComMngVillageDO comMngVillageDO = villageDOList.stream().filter(village -> village.getAlley().equals(vo.getRoad()) && village.getHouseNum().equals(Integer.valueOf(vo.getDoorNo()))).findFirst().orElse(null); |
| | | BeanUtils.copyProperties(vo, comMngPopulationDO); |
| | | if (comMngVillageDO == null) { |
| | | ComMngPopulationImportErrorVO importErrorVO = new ComMngPopulationImportErrorVO(); |
| | | importErrorVO.setErrorMsg("查无:" + vo.getRoad() + "小区/房租地址,请先新建地址"); |
| | | importErrorVO.setErrorPosition("第" + index + "行,第7、8列"); |
| | | populationImportErrorVOList.add(importErrorVO); |
| | | index++; |
| | | continue; |
| | | } |
| | | List<String> userTag = vo.getUserTagStr().stream().map(userTagStr -> userTagStr.split("\\(")[0]).collect(Collectors.toList()); |
| | | comMngPopulationDO.setVillageId(comMngVillageDO.getVillageId()); |
| | | comMngPopulationDO.setActId(comActDO.getCommunityId()); |
| | | comMngPopulationDO.setStreetId(comActDO.getStreetId()); |
| | | comMngPopulationDO.setLabel(Joiner.on(",").join(userTag)); |
| | | comMngPopulationDO.setVillageName(comMngVillageDO.getGroupAt()); |
| | | populationDOList.add(comMngPopulationDO); |
| | | index++; |
| | | } |
| | | //如果有错误,返回错误 |
| | | //暂时注释,等客户完成任务需要恢复 |
| | | /*if(!populationImportErrorVOList.isEmpty()){ |
| | | return R.fail(JSON.toJSONString(populationImportErrorVOList)); |
| | | } |
| | | this.saveBatch(populationDOList);*/ |
| | | |
| | | this.saveBatch(populationDOList); |
| | | if(!populationImportErrorVOList.isEmpty()){ |
| | | return R.fail(JSON.toJSONString(populationImportErrorVOList)); |
| | | } |
| | | return R.ok("共计导入实有人口数量:" + populationDOList.size()); |
| | | } |
| | | |
| | | /** |
| | | * 确认导入实有人口(有则更新,无则新建) |
| | | * @param list 用户信息 |
| | | * @param communityId 社区id |
| | | * @return 导入结果 |
| | | */ |
| | | @Override |
| | | public R listSavePopulationConfirm(List<ComMngPopulationServeExcelVO> list, Long communityId) { |
| | | if (list.size() == 0) { |
| | | return R.fail("数据为空!"); |
| | | } |
| | | List<ComMngPopulationDO> comMngPopulationDOS = populationDAO.selectList(new QueryWrapper<ComMngPopulationDO>().lambda().eq(ComMngPopulationDO::getActId, communityId)); |
| | | //查询该社区所有(实有房屋)小区 |
| | | // List<ComMngVillageDO> villageDOList = comActVillageDAO.selectList(new QueryWrapper<ComMngVillageDO>().lambda().eq(ComMngVillageDO::getCommunityId, communityId)); |
| | | int index = 2; |
| | | for (ComMngPopulationServeExcelVO vo : list) { |
| | | //判断DB和exel数据重复判断 |
| | | boolean result = comMngPopulationDOS.stream().anyMatch(population -> population.getCardNo().equals(vo.getCardNo())); |
| | | if (result) { |
| | | return R.fail("导入实有人口已存在(" + vo.getCardNo() + ")"); |
| | | } |
| | | index++; |
| | | } |
| | | ComActDO comActDO = comActDAO.selectById(communityId); |
| | | ArrayList<ComMngPopulationDO> populationDOList = Lists.newArrayList(); |
| | | list.forEach(vo -> { |
| | |
| | | comMngPopulationDO.setVillageId(comMngVillageDO.getVillageId()); |
| | | comMngPopulationDO.setActId(comActDO.getCommunityId()); |
| | | comMngPopulationDO.setStreetId(comActDO.getStreetId()); |
| | | comMngPopulationDO.setLabel(Joiner.on(",").join(vo.getUserTagStr())); |
| | | List<String> userTag = vo.getUserTagStr().stream().map(userTagStr -> userTagStr.split("\\(")[0]).collect(Collectors.toList()); |
| | | comMngPopulationDO.setLabel(Joiner.on(",").join(userTag)); |
| | | comMngPopulationDO.setVillageName(comMngVillageDO.getGroupAt()); |
| | | populationDOList.add(comMngPopulationDO); |
| | | }); |
| | | this.saveBatch(populationDOList); |
| | | |
| | | if(!populationDOList.isEmpty()){ |
| | | //循环遍历待导入人员信息,如果数据库存在则更新,如果不存在则新建 |
| | | populationDOList.forEach(population -> { |
| | | try { |
| | | //加密身份证号码 |
| | | String cardNo = AESUtil.encrypt128(population.getCardNo(), aesKey); |
| | | population.setCardNo(cardNo); |
| | | //查询这个用户是否存在 |
| | | ComMngPopulationDO comMngPopulationDO = this.populationDAO.selectOne(new QueryWrapper<ComMngPopulationDO>().lambda() |
| | | .eq(ComMngPopulationDO::getCardNo, population.getCardNo())); |
| | | if(comMngPopulationDO != null){ |
| | | population.setId(comMngPopulationDO.getId()); |
| | | BeanUtils.copyProperties(population,comMngPopulationDO); |
| | | this.populationDAO.updateById(population); |
| | | }else{ |
| | | this.populationDAO.insert(population); |
| | | } |
| | | }catch (Exception e){ |
| | | log.error("导入实有人口失败"); |
| | | } |
| | | }); |
| | | } |
| | | return R.ok("共计导入实有人口数量:" + populationDOList.size()); |
| | | } |
| | | |
| | |
| | | } |
| | | return R.ok(resultList); |
| | | } |
| | | |
| | | @Override |
| | | public R editPopulation(EditComMngPopulationVO vo, Long communityId) { |
| | | ComActDO comActDO = comActDAO.selectById(communityId); |
| | | ComMngPopulationDO populationDO = populationDAO.selectById(vo.getId()); |
| | | if(populationDO==null){ |
| | | return R.fail(); |
| | | } |
| | | BeanUtils.copyProperties(vo,populationDO); |
| | | try { |
| | | //TODO 修改拦截器时候需要维护加密操作 |
| | | populationDO.setCardNo(AESUtil.encrypt128(populationDO.getCardNo(), aesKey)); |
| | | populationDO.setPhone(AESUtil.encrypt128(populationDO.getPhone(), aesKey)); |
| | | |
| | | } catch (NoSuchPaddingException e) { |
| | | e.printStackTrace(); |
| | | } catch (NoSuchAlgorithmException e) { |
| | | e.printStackTrace(); |
| | | } catch (InvalidKeyException e) { |
| | | e.printStackTrace(); |
| | | } catch (UnsupportedEncodingException e) { |
| | | e.printStackTrace(); |
| | | } catch (BadPaddingException e) { |
| | | e.printStackTrace(); |
| | | } catch (IllegalBlockSizeException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | |
| | | ComMngVillageDO comMngVillageDO = comActVillageDAO.selectOne(new QueryWrapper<ComMngVillageDO>().eq("alley",vo.getRoad()).eq("house_num",vo.getDoorNo()).eq("community_id",communityId)); |
| | | if (comMngVillageDO == null) { |
| | | throw new ServiceException("街道巷:" + vo.getRoad() + "不存在!"); |
| | | } |
| | | populationDO.setVillageId(comMngVillageDO.getVillageId()); |
| | | populationDO.setActId(comActDO.getCommunityId()); |
| | | populationDO.setStreetId(comActDO.getStreetId()); |
| | | populationDO.setVillageName(comMngVillageDO.getGroupAt()); |
| | | this.updateById(populationDO); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @Override |
| | | public R specialInputUser(PageInputUserDTO pageInputUserDTO){ |
| | | IPage<InputUserInfoVO> iPage = populationDAO.specialInputUser(new Page<>(pageInputUserDTO.getPageNum() |
| | | ,pageInputUserDTO.getPageSize()), pageInputUserDTO); |
| | | return R.ok(iPage); |
| | | } |
| | | |
| | | /** |
| | | * 删除特殊群体人员 |
| | | * @param id 特殊群体id |
| | | * @return 删除结果 |
| | | */ |
| | | @Override |
| | | public R deleteSpecialInputUser(Long id){ |
| | | //查询特殊群体人员 |
| | | ComMngPopulationDO populationDO = this.baseMapper.selectById(id); |
| | | if(populationDO == null){ |
| | | return R.fail("未查询到该记录"); |
| | | } |
| | | populationDO.setLabel(null); |
| | | if(this.baseMapper.updateById(populationDO) > 0){ |
| | | return R.ok(); |
| | | }else{ |
| | | return R.fail(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 查询实有人口电子档信息 |
| | | * @param populationId 实有人口id |
| | | * @return 实有人口电子档信息 |
| | | */ |
| | | @Override |
| | | public R electronicArchivesPopulation(Long populationId){ |
| | | ComMngPopulationDO comMngPopulationDO = populationDAO.selectById(populationId); |
| | | if (ObjectUtils.isEmpty(comMngPopulationDO)) { |
| | | return R.fail("用户信息不存在"); |
| | | } |
| | | //查询当前用户电子档信息 |
| | | if(!StringUtils.isEmpty(comMngPopulationDO.getCardNo())){ |
| | | UserElectronicFileVO electronicFileVO = populationDAO.getSysUserElectronicFile(comMngPopulationDO.getCardNo()); |
| | | if(electronicFileVO != null){ |
| | | return R.ok(electronicFileVO); |
| | | } |
| | | } |
| | | return R.ok(); |
| | | } |
| | | } |
| | |
| | | import com.panzhihua.service_community.dao.ComMngCityDAO; |
| | | import com.panzhihua.service_community.dao.ComMngDistrictDAO; |
| | | import com.panzhihua.service_community.dao.ComMngProvinceDAO; |
| | | import com.panzhihua.service_community.dao.ComMngStructAreaDAO; |
| | | import com.panzhihua.service_community.model.dos.ComMngCityDO; |
| | | import com.panzhihua.service_community.model.dos.ComMngDistrictDO; |
| | | import com.panzhihua.service_community.model.dos.ComMngProvinceDO; |
| | | import com.panzhihua.service_community.model.dos.ComMngStructAreaDO; |
| | | import com.panzhihua.service_community.service.ComMngProvinceService; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | @Resource |
| | | private ComMngDistrictDAO comMngDistrictDAO; |
| | | |
| | | @Resource |
| | | private ComMngStructAreaDAO comMngStructAreaDAO; |
| | | |
| | | @Override |
| | | public R getProvince() { |
| | |
| | | List<ComMngAreaVO> vos = new ArrayList<>(); |
| | | provinceDOS.forEach(p -> { |
| | | ComMngAreaVO pvo = new ComMngAreaVO(p.getProvinceAdcode(), p.getProvinceName()); |
| | | vos.add(pvo); |
| | | List<ComMngCityDO> citys = cityDOS.stream().filter(city -> city.getProvinceAdcode().equals(p.getProvinceAdcode()) && city.getCityAdcode().equals(510400)).collect(Collectors.toList()); |
| | | citys.forEach(c -> { |
| | | ComMngAreaVO cityVo = new ComMngAreaVO(c.getCityAdcode(), c.getCityName()); |
| | |
| | | cityVo.getChildren().add(districtVo); |
| | | }); |
| | | }); |
| | | vos.add(pvo); |
| | | }); |
| | | return R.ok(vos); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.panzhihua.common.enums.RealAssetsCategoryType; |
| | | import com.panzhihua.common.enums.RealAssetsFloorType; |
| | | import com.panzhihua.common.exceptions.ServiceException; |
| | | import com.panzhihua.common.model.dtos.community.ExportRealAssetsExcelDTO; |
| | |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.ComMngRealAssetsExcelVO; |
| | | import com.panzhihua.common.model.vos.community.ComMngRealAssetsVO; |
| | | import com.panzhihua.common.utlis.StringUtils; |
| | | import com.panzhihua.service_community.dao.ComMngRealAssetsDAO; |
| | | import com.panzhihua.service_community.dao.ComMngStructBuildTypeDAO; |
| | | import com.panzhihua.service_community.model.dos.ComMngRealAssetsDO; |
| | |
| | | } else if (l.getFloorType().equals(RealAssetsFloorType.LOW.getInfo())) { |
| | | comMngRealAssetsDO.setFloorType(RealAssetsFloorType.LOW.getCode()); |
| | | } |
| | | if(l.getCategory().equals(RealAssetsCategoryType.PUBLIC.getInfo())){ |
| | | comMngRealAssetsDO.setCategory(RealAssetsCategoryType.PUBLIC.getCode()); |
| | | } |
| | | if(l.getCategory().equals(RealAssetsCategoryType.BUILD.getInfo())){ |
| | | comMngRealAssetsDO.setCategory(RealAssetsCategoryType.BUILD.getCode()); |
| | | } |
| | | comMngRealAssetsDOS.add(comMngRealAssetsDO); |
| | | }); |
| | | boolean batch = this.saveBatch(comMngRealAssetsDOS); |
| | |
| | | package com.panzhihua.service_community.service.impl; |
| | | import java.util.Date; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | |
| | | BeanUtils.copyProperties(l, comMngRealCompanyDO); |
| | | comMngRealCompanyDO.setCommunityId(communityId); |
| | | comMngRealCompanyDOS.add(comMngRealCompanyDO); |
| | | }else{ |
| | | BeanUtils.copyProperties(l, realCompany); |
| | | realCompany.setCommunityId(communityId); |
| | | comMngRealCompanyDOS.add(realCompany); |
| | | } |
| | | }); |
| | | boolean batch = this.saveBatch(comMngRealCompanyDOS); |
| | | boolean batch = this.saveOrUpdateBatch(comMngRealCompanyDOS); |
| | | if (batch) { |
| | | return R.ok(); |
| | | } |
| | | return R.fail("请检查数据是否重复,格合是否正确"); |
| | | return R.fail("请检查格式是否正确"); |
| | | } |
| | | |
| | | @Override |
| | |
| | | page.setSize(pageSize); |
| | | page.setCurrent(pageNum); |
| | | LambdaQueryWrapper<ComMngVillageDO> userLambdaQueryWrapper = Wrappers.lambdaQuery(); |
| | | if(pageComMngVillageDTO.getCommunityId() != null){ |
| | | userLambdaQueryWrapper.eq(ComMngVillageDO::getCommunityId,pageComMngVillageDTO.getCommunityId()); |
| | | } |
| | | if (pageComMngVillageDTO.getAlley() != null) { |
| | | userLambdaQueryWrapper.like(ComMngVillageDO::getAlley, pageComMngVillageDTO.getAlley()); |
| | | } |
| | |
| | | */ |
| | | @Override |
| | | public R deleteVolunteer(ComMngVolunteerMngVO comMngVolunteerMngVO) { |
| | | int delete = comMngVolunteerMngDAO.delete(new QueryWrapper<ComMngVolunteerMngDO>().lambda().eq(ComMngVolunteerMngDO::getPhone, comMngVolunteerMngVO.getPhone())); |
| | | ComMngVolunteerMngDO comMngVolunteerMngDO = comMngVolunteerMngDAO.selectById(comMngVolunteerMngVO.getId()); |
| | | int delete = comMngVolunteerMngDAO.delete(new QueryWrapper<ComMngVolunteerMngDO>().lambda().eq(ComMngVolunteerMngDO::getId, comMngVolunteerMngDO.getId())); |
| | | if (delete>0) { |
| | | return R.ok(); |
| | | } |
| | |
| | | } |
| | | ComMngVolunteerMngVO comMngVolunteerMngVO=new ComMngVolunteerMngVO(); |
| | | BeanUtils.copyProperties(comMngVolunteerMngDO,comMngVolunteerMngVO); |
| | | String phone = comMngVolunteerMngVO.getPhone(); |
| | | comMngVolunteerMngVO.setUserId(comMngVolunteerMngDAO.selectUserIdByPhone(phone)); |
| | | //String phone = comMngVolunteerMngVO.getPhone(); |
| | | //comMngVolunteerMngVO.setUserId(comMngVolunteerMngDAO.selectUserIdByPhone(phone)); |
| | | return R.ok(comMngVolunteerMngVO); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @Override |
| | | public R getVolunteerById(Long id) { |
| | | ComMngVolunteerMngDO comMngVolunteerMngDO = comMngVolunteerMngDAO.selectById(id); |
| | | ComMngVolunteerMngAppletsVO vo=new ComMngVolunteerMngAppletsVO(); |
| | | BeanUtils.copyProperties(comMngVolunteerMngDO,vo); |
| | | return R.ok(vo); |
| | | } |
| | | } |
| | |
| | | } |
| | | page.setSize(pageSize); |
| | | page.setCurrent(pageNum); |
| | | if(!StringUtils.isEmpty(pageComOpsHouseDTO.getUserRealName())){ |
| | | Long userId = comOpsHouseDAO.selectUserIdByName(pageComOpsHouseDTO.getUserRealName()); |
| | | if(!StringUtils.isEmpty(pageComOpsHouseDTO.getUserName())){ |
| | | Long userId = comOpsHouseDAO.selectUserIdByName(pageComOpsHouseDTO.getUserName()); |
| | | if (userId==null){ |
| | | userId = -1L; |
| | | } |
| | |
| | | package com.panzhihua.service_community.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.panzhihua.common.model.dtos.shop.ComShopCartDTO; |
| | | import com.panzhihua.common.model.dtos.shop.ComShopEditNubCartDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.shop.ComShopCartListVO; |
| | | import com.panzhihua.common.model.vos.shop.ComShopCartStoreVO; |
| | | import com.panzhihua.common.model.vos.shop.ComShopCartVO; |
| | | import com.panzhihua.service_community.dao.ComShopCartDAO; |
| | | import com.panzhihua.service_community.dao.ComShopGoodsAttrDAO; |
| | | import com.panzhihua.service_community.dao.ComShopGoodsDAO; |
| | | import com.panzhihua.service_community.dao.ComShopStoreDAO; |
| | | import com.panzhihua.service_community.model.dos.ComShopCartDO; |
| | | import com.panzhihua.service_community.model.dos.ComShopGoodsAttrDO; |
| | | import com.panzhihua.service_community.model.dos.ComShopGoodsDO; |
| | | import com.panzhihua.service_community.model.dos.ComShopStoreDO; |
| | | import com.panzhihua.service_community.service.ComShopCartService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @auther lyq |
| | |
| | | @Service |
| | | public class ComShopCartServiceImpl extends ServiceImpl<ComShopCartDAO, ComShopCartDO> implements ComShopCartService { |
| | | |
| | | @Resource |
| | | private ComShopGoodsDAO shopGoodsDAO; |
| | | @Resource |
| | | private ComShopStoreDAO shopStoreDAO; |
| | | @Resource |
| | | private ComShopGoodsAttrDAO shopGoodsAttrDAO; |
| | | |
| | | |
| | | /** |
| | | * 根据用户id查询购物车列表 |
| | | * @param userId 用户id |
| | | * @return 购物车列表 |
| | | */ |
| | | @Override |
| | | public R shopCartList(Long userId){ |
| | | //返回参数 |
| | | ComShopCartListVO comShopCart = new ComShopCartListVO(); |
| | | //失效宝贝集合 |
| | | List<ComShopCartVO> invalidCartList = new ArrayList<>(); |
| | | //有效宝贝集合 |
| | | List<ComShopCartStoreVO> cartList = new ArrayList<>(); |
| | | |
| | | List<ComShopCartDO> shopCartDOList = this.baseMapper.selectList(new QueryWrapper<ComShopCartDO>().eq("user_id",userId)); |
| | | if(!shopCartDOList.isEmpty()){ |
| | | shopCartDOList.forEach(shopCart->{ |
| | | //查询当前商品是否是有效商品 |
| | | ComShopGoodsDO goodsDO = shopGoodsDAO.selectOne(new QueryWrapper<ComShopGoodsDO>() |
| | | .eq("id",shopCart.getGoodsId()).eq("delete_status",ComShopGoodsDO.deleteStatus.no) |
| | | .eq("status",ComShopGoodsDO.status.sell)); |
| | | if(goodsDO == null){ |
| | | ComShopCartVO invalidCart = new ComShopCartVO(); |
| | | BeanUtils.copyProperties(shopCart,invalidCart); |
| | | invalidCartList.add(invalidCart); |
| | | return; |
| | | } |
| | | |
| | | //有效商品区分店铺 |
| | | if(cartList.isEmpty()){ |
| | | ComShopCartStoreVO cartStoreVO = new ComShopCartStoreVO(); |
| | | //查询商品所属店铺 |
| | | ComShopStoreDO shopStoreDO = shopStoreDAO.selectById(goodsDO.getStoreId()); |
| | | if(shopStoreDO != null){ |
| | | cartStoreVO.setStoreId(shopStoreDO.getId()); |
| | | cartStoreVO.setStoreName(shopStoreDO.getName()); |
| | | cartStoreVO.setStoreLogo(shopStoreDO.getLogo()); |
| | | } |
| | | List<ComShopCartVO> cartsList = new ArrayList<>(); |
| | | ComShopCartVO cartVO = new ComShopCartVO(); |
| | | BeanUtils.copyProperties(shopCart,cartVO); |
| | | cartsList.add(cartVO); |
| | | cartStoreVO.setCartList(cartsList); |
| | | cartList.add(cartStoreVO); |
| | | }else{ |
| | | boolean isOk = true; |
| | | for (ComShopCartStoreVO vo:cartList) { |
| | | if(vo.getStoreId().equals(goodsDO.getStoreId())){ |
| | | isOk = false; |
| | | ComShopCartVO cartVO = new ComShopCartVO(); |
| | | BeanUtils.copyProperties(shopCart,cartVO); |
| | | vo.getCartList().add(cartVO); |
| | | } |
| | | } |
| | | |
| | | if(isOk){ |
| | | ComShopCartStoreVO cartStoreVO = new ComShopCartStoreVO(); |
| | | //查询商品所属店铺 |
| | | ComShopStoreDO shopStoreDO = shopStoreDAO.selectById(goodsDO.getStoreId()); |
| | | if(shopStoreDO != null){ |
| | | cartStoreVO.setStoreId(shopStoreDO.getId()); |
| | | cartStoreVO.setStoreName(shopStoreDO.getName()); |
| | | cartStoreVO.setStoreLogo(shopStoreDO.getLogo()); |
| | | } |
| | | List<ComShopCartVO> cartsList = new ArrayList<>(); |
| | | ComShopCartVO cartVO = new ComShopCartVO(); |
| | | BeanUtils.copyProperties(shopCart,cartVO); |
| | | cartsList.add(cartVO); |
| | | cartStoreVO.setCartList(cartsList); |
| | | cartList.add(cartStoreVO); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | }); |
| | | //设置返回参数 |
| | | comShopCart.setInvalidCartList(invalidCartList); |
| | | comShopCart.setCartList(cartList); |
| | | } |
| | | return R.ok(comShopCart); |
| | | } |
| | | |
| | | /** |
| | | * 购物车添加 |
| | | * @param comShopCartDTO 请求参数 |
| | | * @return 添加结果 |
| | | */ |
| | | @Override |
| | | public R shopAddCart(ComShopCartDTO comShopCartDTO){ |
| | | //查询当前商品是否已经在购物车中 |
| | | ComShopCartDO shopCartDO = this.baseMapper.selectOne(new QueryWrapper<ComShopCartDO>().eq("user_id",comShopCartDTO.getUserId()) |
| | | .eq("goods_id",comShopCartDTO.getGoodsId()).eq("goods_attr_id",comShopCartDTO.getGoodsAttrId())); |
| | | if(shopCartDO == null){//购物车表里未有该商品的记录 |
| | | shopCartDO = new ComShopCartDO(); |
| | | shopCartDO.setUserId(comShopCartDTO.getUserId()); |
| | | shopCartDO.setAmount(comShopCartDTO.getNumber()); |
| | | //查询商品 |
| | | ComShopGoodsDO shopGoodsDO = shopGoodsDAO.selectById(comShopCartDTO.getGoodsId()); |
| | | if(shopGoodsDO == null){ |
| | | return R.fail("未查询到商品信息"); |
| | | } |
| | | shopCartDO.setGoodsName(shopGoodsDO.getName()); |
| | | shopCartDO.setGoodsId(shopGoodsDO.getId()); |
| | | shopCartDO.setStoreId(shopGoodsDO.getStoreId()); |
| | | //查询商品规格 |
| | | ComShopGoodsAttrDO shopGoodsAttrDO = shopGoodsAttrDAO.selectById(comShopCartDTO.getGoodsAttrId()); |
| | | if(shopGoodsAttrDO == null){ |
| | | return R.fail("未查询到商品规格"); |
| | | } |
| | | shopCartDO.setGoodsAttrId(shopGoodsAttrDO.getId()); |
| | | shopCartDO.setGoodsAttr(shopGoodsAttrDO.getGoodsAttr()); |
| | | shopCartDO.setGoodsAttrPic(shopGoodsAttrDO.getAttrPic()); |
| | | shopCartDO.setPrice(shopGoodsAttrDO.getPrice()); |
| | | //执行添加操作 |
| | | if(this.baseMapper.insert(shopCartDO) > 0){ |
| | | return R.ok(); |
| | | }else{ |
| | | return R.fail("添加购物车失败"); |
| | | } |
| | | }else{//购物车已有该商品 |
| | | shopCartDO.setAmount(shopCartDO.getAmount() + comShopCartDTO.getNumber()); |
| | | //执行修改操作 |
| | | if(this.baseMapper.updateById(shopCartDO) > 0){ |
| | | return R.ok(); |
| | | }else{ |
| | | return R.fail("添加购物车失败"); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 购物车内商品数量修改 |
| | | * @param shopEditNubCartDTO 请求参数 |
| | | * @return 修改结果 |
| | | */ |
| | | @Override |
| | | public R shopEditNubCart(ComShopEditNubCartDTO shopEditNubCartDTO){ |
| | | //查询购物车记录 |
| | | ComShopCartDO shopCartDO = this.baseMapper.selectById(shopEditNubCartDTO.getCartId()); |
| | | if(shopCartDO == null){ |
| | | return R.fail("未查询到购物车记录"); |
| | | } |
| | | shopCartDO.setAmount(shopEditNubCartDTO.getNumber()); |
| | | //执行修改操作 |
| | | if(this.baseMapper.updateById(shopCartDO) > 0){ |
| | | return R.ok(); |
| | | }else{ |
| | | return R.fail("修改失败"); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 删除购物车记录 |
| | | * @param Ids 购物车id集合 |
| | | * @return 删除结果 |
| | | */ |
| | | public R shopDelCart(List<Long> Ids){ |
| | | if(this.baseMapper.deleteBatchIds(Ids) > 0){ |
| | | return R.ok(); |
| | | }else{ |
| | | return R.fail("修改失败"); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 查询用户购物车商品数量 |
| | | * @param userId 用户id |
| | | * @return 用户购物车商品数量 |
| | | */ |
| | | public R shopCartUserTotal(Long userId){ |
| | | int goodsNum = 0; |
| | | //查询用户购物车所有商品集合 |
| | | List<ComShopCartDO> shopCartDOList = this.baseMapper.selectList(new QueryWrapper<ComShopCartDO>().eq("user_id",userId)); |
| | | if(!shopCartDOList.isEmpty()){ |
| | | for (ComShopCartDO cartDO:shopCartDOList) { |
| | | //查询当前商品是否是有效商品 |
| | | ComShopGoodsDO goodsDO = shopGoodsDAO.selectOne(new QueryWrapper<ComShopGoodsDO>() |
| | | .eq("id",cartDO.getGoodsId()).eq("delete_status",ComShopGoodsDO.deleteStatus.no) |
| | | .eq("status",ComShopGoodsDO.status.sell)); |
| | | |
| | | if(goodsDO != null){ |
| | | goodsNum++; |
| | | } |
| | | } |
| | | } |
| | | return R.ok(goodsNum); |
| | | } |
| | | } |
| | |
| | | package com.panzhihua.service_community.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.google.common.collect.Lists; |
| | | import com.panzhihua.common.exceptions.ServiceException; |
| | | import com.panzhihua.common.model.dtos.shop.PageComShopGoodsDTO; |
| | | import com.panzhihua.common.model.dtos.shop.ComShopGoodsDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.shop.ComShopStoreVO; |
| | | import com.panzhihua.common.model.vos.shop.ShopGoodsVO; |
| | | import com.panzhihua.common.model.vos.shop.AddShopGoodsAttrVO; |
| | | import com.panzhihua.common.model.vos.shop.PageShopGoodsVO; |
| | | import com.panzhihua.common.model.vos.shop.AddShopGoodsVO; |
| | | import com.panzhihua.common.utlis.DifferentLongListUtil; |
| | | import com.panzhihua.common.utlis.StringUtils; |
| | | import com.panzhihua.service_community.dao.ComShopGoodsAttrDAO; |
| | | import com.panzhihua.common.model.vos.shop.ComShopGoodsAttrVO; |
| | | import com.panzhihua.common.model.vos.shop.ComShopGoodsVO; |
| | | import com.panzhihua.common.model.vos.shop.PageShopStoreVO; |
| | | import com.panzhihua.service_community.dao.ComShopGoodsDAO; |
| | | import com.panzhihua.service_community.model.dos.ComShopGoodsAttrDO; |
| | | import com.panzhihua.service_community.dao.ComShopStoreDAO; |
| | | import com.panzhihua.service_community.model.dos.ComShopGoodsDO; |
| | | import com.panzhihua.service_community.model.dos.ComShopStoreDO; |
| | | import com.panzhihua.service_community.service.ComShopGoodsService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * @auther lyq |
| | |
| | | @Slf4j |
| | | @Service |
| | | public class ComShopGoodsServiceImpl extends ServiceImpl<ComShopGoodsDAO, ComShopGoodsDO> implements ComShopGoodsService { |
| | | @Resource |
| | | private ComShopGoodsAttrServiceImpl goodsAttrService; |
| | | @Resource |
| | | private ComShopGoodsAttrDAO shopGoodsAttrDAO; |
| | | @Resource |
| | | private ComShopStoreDAO shopStoreDAO; |
| | | |
| | | @Override |
| | | public R saveShopGoods(ShopGoodsVO shopGoodsVO) { |
| | | if (shopGoodsVO == null) { |
| | | public R saveShopGoods(AddShopGoodsVO addShopGoodsVO) { |
| | | if (addShopGoodsVO == null) { |
| | | return R.ok("500", "数据为空!"); |
| | | } |
| | | String[] images = addShopGoodsVO.getGoodsPic().split(","); |
| | | ComShopGoodsDO shopGoodsDO = new ComShopGoodsDO(); |
| | | BeanUtils.copyProperties(shopGoodsVO, shopGoodsDO); |
| | | BeanUtils.copyProperties(addShopGoodsVO, shopGoodsDO); |
| | | shopGoodsDO.setOriginalPrice(addShopGoodsVO.getPrice()); |
| | | if (images.length > 1) { |
| | | shopGoodsDO.setGoodsPic(images[0]); |
| | | } |
| | | shopGoodsDO.setImages(addShopGoodsVO.getGoodsPic()); |
| | | shopGoodsDO.setSale(0); |
| | | this.baseMapper.insert(shopGoodsDO); |
| | | shopGoodsDO.setDetails(addShopGoodsVO.getDetails()); |
| | | int goodsId = this.baseMapper.insert(shopGoodsDO); |
| | | if (goodsId > 0) { |
| | | ArrayList<ComShopGoodsAttrDO> goodsAttrDOS = Lists.newArrayList(); |
| | | ComShopGoodsDO goodDO = this.baseMapper.selectById(shopGoodsDO.getId()); |
| | | addShopGoodsVO.getGoodsAttrVOList().forEach(goodsAttr -> {//维护商品规格表 |
| | | if (goodDO == null) { |
| | | throw new ServiceException("商家id不存在!"); |
| | | } |
| | | ComShopGoodsAttrDO shopGoodsAttrDO = new ComShopGoodsAttrDO(); |
| | | shopGoodsAttrDO.setGoodsId(shopGoodsDO.getId()); |
| | | shopGoodsAttrDO.setStoreId(goodDO.getStoreId()); |
| | | shopGoodsAttrDO.setGoodsName(goodDO.getName()); |
| | | shopGoodsAttrDO.setGoodsAttr(goodsAttr.getGoodsAttr()); |
| | | shopGoodsAttrDO.setIsDefault(1); |
| | | shopGoodsAttrDO.setPrice(goodsAttr.getAttrPrice()); |
| | | shopGoodsAttrDO.setAttrPic(images[0]); |
| | | goodsAttrDOS.add(shopGoodsAttrDO); |
| | | }); |
| | | if (addShopGoodsVO.getGoodsAttrVOList().size() < 1) {//如果没有规格参数加默认 |
| | | ComShopGoodsAttrDO shopGoodsAttrDO = new ComShopGoodsAttrDO(); |
| | | shopGoodsAttrDO.setGoodsId(shopGoodsDO.getId()); |
| | | shopGoodsAttrDO.setStoreId(goodDO.getStoreId()); |
| | | shopGoodsAttrDO.setGoodsName(goodDO.getName()); |
| | | shopGoodsAttrDO.setGoodsAttr("默认"); |
| | | shopGoodsAttrDO.setIsDefault(1); |
| | | shopGoodsAttrDO.setPrice(goodDO.getPrice()); |
| | | shopGoodsAttrDO.setAttrPic(images[0]); |
| | | goodsAttrService.save(shopGoodsAttrDO); |
| | | } |
| | | if (goodsAttrDOS.size() > 0) { |
| | | goodsAttrService.saveBatch(goodsAttrDOS); |
| | | } |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | @Override |
| | | public R pageStoreList(PageComShopGoodsDTO pageComShopGoodsDTO) { |
| | | Page page = new Page<>(pageComShopGoodsDTO.getPageNum(), pageComShopGoodsDTO.getPageSize()); |
| | | IPage<ComShopStoreVO> comShopStoreVOIPage = this.baseMapper.pageShopGoods(page, pageComShopGoodsDTO); |
| | | public R pageGoodsList(PageComShopGoodsDTO pageComShopGoodsDTO) { |
| | | long pageNum = pageComShopGoodsDTO.getPageNum()!=null?pageComShopGoodsDTO.getPageNum():1; |
| | | long pageSize = pageComShopGoodsDTO.getPageSize()!=null?pageComShopGoodsDTO.getPageSize():10; |
| | | Page page = new Page<>(pageNum, pageSize); |
| | | IPage<PageShopGoodsVO> comShopStoreVOIPage = this.baseMapper.pageShopGoods(page, pageComShopGoodsDTO); |
| | | if (!comShopStoreVOIPage.getRecords().isEmpty()) { |
| | | comShopStoreVOIPage.getRecords().forEach(shopGoods -> { |
| | | List<ComShopGoodsAttrDO> goodsAttrDOs = shopGoodsAttrDAO.selectList(new QueryWrapper<ComShopGoodsAttrDO>().lambda().eq(ComShopGoodsAttrDO::getGoodsId, shopGoods.getId())); |
| | | ArrayList<AddShopGoodsAttrVO> goodsAttrVOList = Lists.newArrayList(); |
| | | for (ComShopGoodsAttrDO oneGoodsAttrDO : goodsAttrDOs) { |
| | | AddShopGoodsAttrVO goodsAttrVO = new AddShopGoodsAttrVO(); |
| | | goodsAttrVO.setGoodsAttrId(oneGoodsAttrDO.getId()); |
| | | goodsAttrVO.setGoodsAttr(oneGoodsAttrDO.getGoodsAttr()); |
| | | goodsAttrVO.setAttrPrice(oneGoodsAttrDO.getPrice()); |
| | | goodsAttrVOList.add(goodsAttrVO); |
| | | } |
| | | shopGoods.setGoodsAttts(goodsAttrVOList); |
| | | }); |
| | | } |
| | | return R.ok(comShopStoreVOIPage); |
| | | } |
| | | |
| | | @Override |
| | | public R editShopGoods(Long id, ShopGoodsVO shopGoodsVO) { |
| | | if (shopGoodsVO == null) { |
| | | public R editShopGoods(Long id, AddShopGoodsVO addShopGoodsVO) { |
| | | if (addShopGoodsVO == null) { |
| | | return R.ok("500", "数据为空!"); |
| | | } |
| | | LambdaQueryWrapper<ComShopGoodsDO> query = new LambdaQueryWrapper<ComShopGoodsDO>().eq(ComShopGoodsDO::getId, id); |
| | | ComShopGoodsDO shopGoodsDO = new ComShopGoodsDO(); |
| | | BeanUtils.copyProperties(shopGoodsVO,shopGoodsDO); |
| | | BeanUtils.copyProperties(addShopGoodsVO, shopGoodsDO); |
| | | shopGoodsDO.setOriginalPrice(addShopGoodsVO.getPrice()); |
| | | int update = this.baseMapper.update(shopGoodsDO, query); |
| | | return update > 0 ? R.ok() : R.fail(); |
| | | if (update < 1) { |
| | | throw new ServiceException("修改失败"); |
| | | } |
| | | //修改规格表 |
| | | List<ComShopGoodsAttrDO> comShopGoodsAttrDOS = shopGoodsAttrDAO.selectList(new LambdaQueryWrapper<ComShopGoodsAttrDO>().eq(ComShopGoodsAttrDO::getGoodsId, id)); |
| | | if (addShopGoodsVO.getGoodsAttrVOList().size() == 0) { |
| | | shopGoodsAttrDAO.delete(new LambdaQueryWrapper<ComShopGoodsAttrDO>().eq(ComShopGoodsAttrDO::getGoodsId, id)); |
| | | ComShopGoodsAttrDO comShopGoodsAttrDO = new ComShopGoodsAttrDO(); |
| | | comShopGoodsAttrDO.setGoodsId(id); |
| | | comShopGoodsAttrDO.setStoreId(addShopGoodsVO.getStoreId()); |
| | | comShopGoodsAttrDO.setGoodsName(addShopGoodsVO.getName()); |
| | | comShopGoodsAttrDO.setGoodsAttr("默认"); |
| | | comShopGoodsAttrDO.setAttrPic(addShopGoodsVO.getGoodsPic()); |
| | | comShopGoodsAttrDO.setIsDefault(1); |
| | | comShopGoodsAttrDO.setPrice(addShopGoodsVO.getPrice()); |
| | | shopGoodsAttrDAO.insert(comShopGoodsAttrDO); |
| | | }else{ |
| | | List<Long> attrIds = comShopGoodsAttrDOS.stream().map(ComShopGoodsAttrDO::getId).collect(Collectors.toList()); |
| | | List<Long> voAttrIds = addShopGoodsVO.getGoodsAttrVOList().stream().map(AddShopGoodsAttrVO::getGoodsAttrId).collect(Collectors.toList()); |
| | | //需要删除的规格ID——针对编辑时删除了规格的情况 |
| | | List<Long> deleteIds = DifferentLongListUtil.getDiffrent(attrIds, voAttrIds); |
| | | if(deleteIds.size()!=0){ |
| | | shopGoodsAttrDAO.deleteBatchIds(deleteIds); |
| | | } |
| | | addShopGoodsVO.getGoodsAttrVOList().forEach(goodsAttr -> { |
| | | ComShopGoodsAttrDO comShopGoodsAttrDO = shopGoodsAttrDAO.selectById(goodsAttr.getGoodsAttrId()); |
| | | if(comShopGoodsAttrDO!=null){ |
| | | comShopGoodsAttrDO.setPrice(goodsAttr.getAttrPrice()); |
| | | comShopGoodsAttrDO.setGoodsAttr(goodsAttr.getGoodsAttr()); |
| | | shopGoodsAttrDAO.updateById(comShopGoodsAttrDO); |
| | | }else{ |
| | | comShopGoodsAttrDO = new ComShopGoodsAttrDO(); |
| | | comShopGoodsAttrDO.setGoodsId(id); |
| | | comShopGoodsAttrDO.setStoreId(addShopGoodsVO.getStoreId()); |
| | | comShopGoodsAttrDO.setGoodsName(addShopGoodsVO.getName()); |
| | | comShopGoodsAttrDO.setGoodsAttr(goodsAttr.getGoodsAttr()); |
| | | comShopGoodsAttrDO.setAttrPic(addShopGoodsVO.getGoodsPic()); |
| | | comShopGoodsAttrDO.setIsDefault(1); |
| | | comShopGoodsAttrDO.setPrice(goodsAttr.getAttrPrice()); |
| | | shopGoodsAttrDAO.insert(comShopGoodsAttrDO); |
| | | } |
| | | }); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | @Override |
| | | public R deleteShopGoods(Long[] id) { |
| | | ComShopGoodsDO storeDO = new ComShopGoodsDO(); |
| | | storeDO.setDeleteStatus(2); |
| | | LambdaQueryWrapper<ComShopGoodsDO> query = new LambdaQueryWrapper<ComShopGoodsDO>().eq(ComShopGoodsDO::getId, id); |
| | | int update = this.baseMapper.update(storeDO, query); |
| | | return update > 0 ? R.ok() : R.fail(); |
| | | LambdaQueryWrapper<ComShopGoodsDO> query = new LambdaQueryWrapper<ComShopGoodsDO>().in(ComShopGoodsDO::getId, id); |
| | | List<ComShopGoodsDO> comShopGoodsDOS = this.baseMapper.selectList(query); |
| | | for (ComShopGoodsDO one : comShopGoodsDOS) { |
| | | one.setDeleteStatus(2); |
| | | this.baseMapper.updateById(one); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | @Override |
| | | public R changeStatus(Long id, Integer status) { |
| | | ComShopGoodsDO shopGoodsDO = this.baseMapper.selectById(id); |
| | | if (shopGoodsDO == null) { |
| | | return R.fail("id有误!"); |
| | | } |
| | | shopGoodsDO.setStatus(status); |
| | | this.baseMapper.updateById(shopGoodsDO); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 分页查询商品列表 |
| | | * |
| | | * @param comShopGoodsDTO 请求参数 |
| | | * @return 商品列表 |
| | | */ |
| | | @Override |
| | | public R pageShopGoods(ComShopGoodsDTO comShopGoodsDTO) { |
| | | Page page = new Page<>(comShopGoodsDTO.getPageNum(), comShopGoodsDTO.getPageSize()); |
| | | IPage<ComShopGoodsVO> goodsVOIPage = this.baseMapper.pageShopGoodByApps(page, comShopGoodsDTO); |
| | | if (!goodsVOIPage.getRecords().isEmpty()) { |
| | | goodsVOIPage.getRecords().forEach(goodsVo -> { |
| | | List<ComShopGoodsAttrVO> goodsAttrList = shopGoodsAttrDAO.getGoodsAttr(goodsVo.getId()); |
| | | if (!goodsAttrList.isEmpty()) { |
| | | goodsVo.setGoodsAttrList(goodsAttrList); |
| | | } |
| | | }); |
| | | } |
| | | return R.ok(goodsVOIPage); |
| | | } |
| | | |
| | | /** |
| | | * 根据商品id查询商品信息 |
| | | * |
| | | * @param goodsId 商品id |
| | | * @return 商品信息 |
| | | */ |
| | | @Override |
| | | public R shopGoodsDetail(Long goodsId) { |
| | | |
| | | //根据id查询商品信息 |
| | | ComShopGoodsDO goodsDO = this.baseMapper.selectById(goodsId); |
| | | if (goodsDO == null || goodsDO.getDeleteStatus().equals(ComShopGoodsDO.deleteStatus.yes)) { |
| | | return R.fail(403, "商品不存在"); |
| | | } |
| | | if (!goodsDO.getStatus().equals(ComShopGoodsDO.status.sell)) { |
| | | return R.fail(405, "商品已下架"); |
| | | } |
| | | |
| | | //根据商品id查询商品规格信息 |
| | | List<ComShopGoodsAttrVO> goodsAttrList = new ArrayList<>(); |
| | | List<ComShopGoodsAttrDO> goodsAttrDOS = shopGoodsAttrDAO.selectList(new QueryWrapper<ComShopGoodsAttrDO>().eq("goods_id", goodsId)); |
| | | goodsAttrDOS.forEach(attrDO -> { |
| | | ComShopGoodsAttrVO goodsAttrVO = new ComShopGoodsAttrVO(); |
| | | BeanUtils.copyProperties(attrDO, goodsAttrVO); |
| | | goodsAttrList.add(goodsAttrVO); |
| | | }); |
| | | |
| | | //查询商品店铺信息 |
| | | ComShopStoreDO shopStoreDO = shopStoreDAO.selectById(goodsDO.getStoreId()); |
| | | PageShopStoreVO shopStoreVO = new PageShopStoreVO(); |
| | | BeanUtils.copyProperties(shopStoreDO, shopStoreVO); |
| | | |
| | | //设置值 |
| | | ComShopGoodsVO shopGoods = new ComShopGoodsVO(); |
| | | BeanUtils.copyProperties(goodsDO, shopGoods); |
| | | shopGoods.setGoodsAttrList(goodsAttrList); |
| | | shopGoods.setShopStoreVO(shopStoreVO); |
| | | return R.ok(shopGoods); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.service_community.service.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.panzhihua.common.model.dtos.PageDTO; |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.shop.ShopOperLogVO; |
| | | import com.panzhihua.common.model.vos.shop.ShopStoreVO; |
| | | import com.panzhihua.common.service.user.UserService; |
| | | import com.panzhihua.service_community.dao.ComShopOperLogDAO; |
| | | import com.panzhihua.service_community.model.dos.ComShopOperLogDO; |
| | | import com.panzhihua.service_community.service.ComShopOperLogService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * @auther cedoo |
| | | * @create 2021-4-17 10:51:12 |
| | | * @describe 日志服务 |
| | | */ |
| | | @Slf4j |
| | | @Service |
| | | public class ComShopOperLogServiceImpl extends ServiceImpl<ComShopOperLogDAO, ComShopOperLogDO> implements ComShopOperLogService { |
| | | |
| | | @Resource |
| | | private UserService userService; |
| | | |
| | | @Override |
| | | public R saveLog(ShopOperLogVO shopOperLogVO) { |
| | | if (shopOperLogVO == null) { |
| | | return R.ok("500", "数据为空!"); |
| | | } |
| | | ComShopOperLogDO theDo = new ComShopOperLogDO(); |
| | | BeanUtils.copyProperties(shopOperLogVO, theDo); |
| | | this.baseMapper.insert(theDo); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @Override |
| | | public R pageShopOperLog(PageDTO pageDTO) { |
| | | Page page = new Page<>(pageDTO.getPageNum(), pageDTO.getPageSize()); |
| | | IPage<ComShopOperLogDO> comShopOperLogDOIPage = |
| | | this.baseMapper.selectPage(page, new LambdaQueryWrapper<ComShopOperLogDO>().orderByDesc(ComShopOperLogDO::getOperTime).eq(ComShopOperLogDO::getUserId, pageDTO.getUserId())) |
| | | ; |
| | | |
| | | IPage<ShopOperLogVO> comShopOperLogVOIPage = |
| | | comShopOperLogDOIPage.convert(comShopOperLogDO -> { |
| | | ShopOperLogVO shopOperLogVO = new ShopOperLogVO(); |
| | | BeanUtils.copyProperties(comShopOperLogDO, shopOperLogVO); |
| | | /** |
| | | * 隐藏敏感信息 |
| | | */ |
| | | shopOperLogVO.setJsonResult("****"); |
| | | shopOperLogVO.setOperParam("****"); |
| | | |
| | | String businessTypeName = ""; |
| | | switch (comShopOperLogDO.getBusinessType()){ |
| | | case 1: businessTypeName = "登录";break; |
| | | case 2: businessTypeName = "修改密码";break; |
| | | case 3: businessTypeName = "添加商品";break; |
| | | case 4: businessTypeName = "编辑商品";break; |
| | | case 5: businessTypeName = "下架商品";break; |
| | | case 6: businessTypeName = "上架商品";break; |
| | | case 7: businessTypeName = "删除商品";break; |
| | | case 8: businessTypeName = "取消订单";break; |
| | | case 9: businessTypeName = "发货";break; |
| | | case 10: businessTypeName = "配送";break; |
| | | case 11:businessTypeName = "查看订单详情";break; |
| | | case 12:businessTypeName = "导出订单";break; |
| | | case 13:businessTypeName = "导出资金流水";break; |
| | | default: break; |
| | | } |
| | | shopOperLogVO.setBusinessName(businessTypeName); |
| | | |
| | | R<LoginUserInfoVO> usrInfo = userService.getUserInfoByUserId(comShopOperLogDO.getUserId()+""); |
| | | if(R.isOk(usrInfo)) { |
| | | LoginUserInfoVO loginUserInfoVO = JSONObject.parseObject(JSONObject.toJSONString(usrInfo.getData()), LoginUserInfoVO.class); |
| | | shopOperLogVO.setUserName(loginUserInfoVO.getName()); |
| | | } |
| | | return shopOperLogVO; |
| | | }); |
| | | return R.ok(comShopOperLogVOIPage); |
| | | } |
| | | } |
| | |
| | | package com.panzhihua.service_community.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.panzhihua.common.model.dtos.PageDTO; |
| | | import com.panzhihua.common.model.dtos.shop.*; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.utlis.DateUtils; |
| | | import com.panzhihua.common.utlis.WxPayUtils; |
| | | import com.panzhihua.service_community.dao.ComShopOrderDAO; |
| | | import com.panzhihua.service_community.model.dos.ComShopOrderDO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.shop.*; |
| | | import com.panzhihua.common.utlis.OrderNoUtils; |
| | | import com.panzhihua.common.utlis.StringUtils; |
| | | import com.panzhihua.service_community.dao.*; |
| | | import com.panzhihua.service_community.model.dos.*; |
| | | import com.panzhihua.service_community.service.ComShopOrderService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @auther lyq |
| | |
| | | @Service |
| | | public class ComShopOrderServiceImpl extends ServiceImpl<ComShopOrderDAO, ComShopOrderDO> implements ComShopOrderService { |
| | | |
| | | @Resource |
| | | private ComShopGoodsDAO comShopGoodsDAO; |
| | | @Resource |
| | | private ComShopGoodsAttrDAO comShopGoodsAttrDAO; |
| | | @Resource |
| | | private ComShopCartDAO comShopCartDAO; |
| | | @Resource |
| | | private ComShopStoreDAO comShopStoreDAO; |
| | | @Resource |
| | | private ComShopUserAddressDAO comShopUserAddressDAO; |
| | | @Resource |
| | | private ComShopOrderOperateDAO comShopOrderOperateDAO; |
| | | @Resource |
| | | private ComShopOrderGoodsDAO comShopOrderGoodsDAO; |
| | | @Resource |
| | | private ComShopOrderDAO comShopOrderDAO; |
| | | @Resource |
| | | private ComShopOrderPayDAO comShopOrderPayDAO; |
| | | @Value("${min.app.isTest}") |
| | | private Boolean isTest; |
| | | @Value("${min.app.appid}") |
| | | private String appid; |
| | | @Value("${min.app.payKey}") |
| | | private String payKey; |
| | | @Value("${min.app.mchId}") |
| | | private String mchId; |
| | | @Value("${min.app.notifyUrl}") |
| | | private String notifyUrl; |
| | | |
| | | /** |
| | | * 订单预览 |
| | | * |
| | | * @param orderPreviewDTO 请求参数 |
| | | * @return 订单预览数据 |
| | | */ |
| | | @Override |
| | | public R orderPreview(ComShopOrderPreviewDTO orderPreviewDTO){ |
| | | |
| | | //返回参数 |
| | | ComShopOrderPreviewVO orderPreviewVO = new ComShopOrderPreviewVO(); |
| | | //返回商品列表 |
| | | List<ComShopOrderGoodsVO> orderGoodsList = new ArrayList<>(); |
| | | Long storeId = 0L; |
| | | BigDecimal orderTotal = BigDecimal.ZERO; |
| | | Integer orderGoodsTotal = 0; |
| | | //判断提交方式 |
| | | if(orderPreviewDTO.getSubmitType().equals(ComShopOrderPreviewDTO.submitType.details)){//详情页提交 |
| | | //查询商品信息 |
| | | ComShopGoodsDO goodsDO = comShopGoodsDAO.selectOne(new QueryWrapper<ComShopGoodsDO>().eq("id",orderPreviewDTO.getGoodsId()) |
| | | .eq("status",ComShopGoodsDO.status.sell).eq("delete_status",ComShopGoodsDO.deleteStatus.no)); |
| | | if(goodsDO == null){ |
| | | return R.fail("商品已下架或已删除"); |
| | | } |
| | | //设置店铺id |
| | | storeId = goodsDO.getStoreId(); |
| | | |
| | | //查询商品规格信息 |
| | | ComShopGoodsAttrDO goodsAttrDO = comShopGoodsAttrDAO.selectById(orderPreviewDTO.getGoodsAttrId()); |
| | | if(goodsAttrDO == null){ |
| | | return R.fail("商品规格不存在"); |
| | | } |
| | | |
| | | orderTotal = goodsAttrDO.getPrice().multiply(BigDecimal.valueOf(orderPreviewDTO.getBuyNum())); |
| | | orderGoodsTotal = orderPreviewDTO.getBuyNum(); |
| | | //商品信息赋值 |
| | | ComShopOrderGoodsVO orderGoodsVO = new ComShopOrderGoodsVO(); |
| | | orderGoodsVO.setGoodsName(goodsDO.getName()); |
| | | orderGoodsVO.setGoodsId(goodsDO.getId()); |
| | | orderGoodsVO.setGoodsAttrId(goodsAttrDO.getId()); |
| | | orderGoodsVO.setGoodsPic(goodsAttrDO.getAttrPic()); |
| | | orderGoodsVO.setPrice(goodsAttrDO.getPrice()); |
| | | orderGoodsVO.setNum(orderPreviewDTO.getBuyNum()); |
| | | orderGoodsList.add(orderGoodsVO); |
| | | }else if(orderPreviewDTO.getSubmitType().equals(ComShopOrderPreviewDTO.submitType.cart)){//购物车提交 |
| | | List<ComShopCartDO> cartList = comShopCartDAO.selectBatchIds(orderPreviewDTO.getCartIds()); |
| | | if(cartList.isEmpty()){ |
| | | return R.fail("未找到购物车商品信息"); |
| | | } |
| | | //设置店铺id |
| | | storeId = cartList.get(0).getStoreId(); |
| | | //循环遍历购物车商品信息 |
| | | for (ComShopCartDO cartDO:cartList) { |
| | | //商品信息赋值 |
| | | ComShopOrderGoodsVO orderGoodsVO = new ComShopOrderGoodsVO(); |
| | | orderGoodsVO.setGoodsId(cartDO.getGoodsId()); |
| | | orderGoodsVO.setGoodsAttrId(cartDO.getGoodsAttrId()); |
| | | orderGoodsVO.setGoodsPic(cartDO.getGoodsAttrPic()); |
| | | orderGoodsVO.setNum(cartDO.getAmount()); |
| | | orderGoodsVO.setGoodsName(cartDO.getGoodsName()); |
| | | //查询商品规格 |
| | | ComShopGoodsAttrDO goodsAttrDO = comShopGoodsAttrDAO.selectById(cartDO.getGoodsAttrId()); |
| | | if(goodsAttrDO != null){ |
| | | orderGoodsVO.setPrice(goodsAttrDO.getPrice()); |
| | | }else{ |
| | | orderGoodsVO.setPrice(BigDecimal.ZERO); |
| | | } |
| | | orderTotal = orderTotal.add(orderGoodsVO.getPrice().multiply(BigDecimal.valueOf(cartDO.getAmount()))); |
| | | orderGoodsTotal += cartDO.getAmount(); |
| | | orderGoodsList.add(orderGoodsVO); |
| | | } |
| | | } |
| | | orderPreviewVO.setOrderTotal(orderTotal); |
| | | orderPreviewVO.setOrderGoodsTotal(orderGoodsTotal); |
| | | orderPreviewVO.setOrderGoodsList(orderGoodsList); |
| | | |
| | | //查询店铺信息 |
| | | ComShopStoreDO storeDO = comShopStoreDAO.selectById(storeId); |
| | | if(storeDO != null){ |
| | | PageShopStoreVO shopStoreVO = new PageShopStoreVO(); |
| | | BeanUtils.copyProperties(storeDO,shopStoreVO); |
| | | orderPreviewVO.setShopStoreVO(shopStoreVO); |
| | | } |
| | | |
| | | //查询默认收货地址 |
| | | //查询上次购买记录的收货地址 |
| | | List<ComShopOrderDO> shopOrders = this.baseMapper.selectList(new QueryWrapper<ComShopOrderDO>() |
| | | .eq("user_id",orderPreviewDTO.getUserId()).orderByDesc("create_at")); |
| | | if(shopOrders.isEmpty()){//未查询到用户上一笔订单 |
| | | //查询用户收货地址中的默认地址 |
| | | ComShopUserAddressDO userAddressDO = comShopUserAddressDAO.selectOne(new QueryWrapper<ComShopUserAddressDO>() |
| | | .eq("delete_status", 2) |
| | | .eq("user_id",orderPreviewDTO.getUserId()).eq("is_default",ComShopUserAddressDO.isDefault.yes)); |
| | | if(userAddressDO != null){ |
| | | ComShopUserAddressVO userAddressVO = new ComShopUserAddressVO(); |
| | | BeanUtils.copyProperties(userAddressDO,userAddressVO); |
| | | orderPreviewVO.setUserAddressVO(userAddressVO); |
| | | }else{ |
| | | List<ComShopUserAddressDO> userAddressDOList = comShopUserAddressDAO.selectList(new QueryWrapper<ComShopUserAddressDO>() |
| | | .eq("user_id",orderPreviewDTO.getUserId()).orderByDesc("create_at")); |
| | | if(!userAddressDOList.isEmpty()){ |
| | | ComShopUserAddressVO userAddressVO = new ComShopUserAddressVO(); |
| | | BeanUtils.copyProperties(userAddressDOList.get(0),userAddressVO); |
| | | orderPreviewVO.setUserAddressVO(userAddressVO); |
| | | } |
| | | } |
| | | }else{//查询到用户上一笔订单 |
| | | ComShopUserAddressDO userAddressDO = comShopUserAddressDAO.selectById(shopOrders.get(0).getReceiverId()); |
| | | if(userAddressDO != null){ |
| | | if(userAddressDO.getDeleteStatus() == 2) { |
| | | ComShopUserAddressVO userAddressVO = new ComShopUserAddressVO(); |
| | | BeanUtils.copyProperties(userAddressDO, userAddressVO); |
| | | orderPreviewVO.setUserAddressVO(userAddressVO); |
| | | } |
| | | } |
| | | } |
| | | return R.ok(orderPreviewVO); |
| | | } |
| | | |
| | | /** |
| | | * 创建订单 |
| | | * @param orderCreateDTO 创建订单请求参数 |
| | | * @return 创建结果 |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @Override |
| | | public R orderCreate(ComShopOrderCreateDTO orderCreateDTO){ |
| | | //创建返回参数 |
| | | ComShopOrderVO shopOrderVO = new ComShopOrderVO(); |
| | | //查询用户收货地址 |
| | | ComShopUserAddressDO userAddressDO = comShopUserAddressDAO.selectById(orderCreateDTO.getReceiverId()); |
| | | if(userAddressDO == null||userAddressDO.getDeleteStatus()!=2){ |
| | | return R.fail("收货地址不存在"); |
| | | } |
| | | //用户id |
| | | Long userId = orderCreateDTO.getUserId(); |
| | | //店铺id |
| | | Long storeId = 0L; |
| | | //生成订单号 |
| | | String orderNo = OrderNoUtils.NextOrderNo(userId); |
| | | //配送方式 |
| | | Integer deliveryType = 0; |
| | | //订单总金额 |
| | | BigDecimal orderTotal = BigDecimal.ZERO; |
| | | //创建订单商品信息 |
| | | List<ComShopOrderGoodsDO> orderGoodsDOList = new ArrayList<>(); |
| | | if(!orderCreateDTO.getOrderGoodsList().isEmpty()){ |
| | | for (ComShopOrderCreateGoodsDTO createGoodsDTO:orderCreateDTO.getOrderGoodsList()) { |
| | | //查询当前商品信息 |
| | | ComShopGoodsDO goodsDO = comShopGoodsDAO.selectOne(new QueryWrapper<ComShopGoodsDO>() |
| | | .eq("id",createGoodsDTO.getGoodsId()).eq("delete_status",ComShopGoodsDO.deleteStatus.no) |
| | | .eq("status",ComShopGoodsDO.status.sell)); |
| | | if(goodsDO == null){ |
| | | log.error("未查询到商品信息,商品已下架活已删除,商品id" + createGoodsDTO.getGoodsId()); |
| | | continue; |
| | | } |
| | | storeId = goodsDO.getStoreId(); |
| | | deliveryType = goodsDO.getDeliveryType(); |
| | | ComShopOrderGoodsDO orderGoodsDO = new ComShopOrderGoodsDO(); |
| | | orderGoodsDO.setGoodsId(goodsDO.getId()); |
| | | orderGoodsDO.setGoodsName(goodsDO.getName()); |
| | | orderGoodsDO.setStoreId(storeId); |
| | | orderGoodsDO.setUserId(userId); |
| | | orderGoodsDO.setAmount(createGoodsDTO.getNum()); |
| | | orderGoodsDO.setOrderNo(orderNo); |
| | | //查询当前商品规格 |
| | | ComShopGoodsAttrDO goodsAttrDO = comShopGoodsAttrDAO.selectById(createGoodsDTO.getGoodsAttrId()); |
| | | if(goodsAttrDO == null){ |
| | | log.error("未查询到商品规格信息,商品id" + createGoodsDTO.getGoodsId() + "商品规格id:" + createGoodsDTO.getGoodsAttrId()); |
| | | continue; |
| | | } |
| | | orderGoodsDO.setGoodsAttrId(goodsAttrDO.getId()); |
| | | orderGoodsDO.setGoodsAttrPrice(goodsAttrDO.getPrice()); |
| | | orderGoodsDO.setGoodsAttrPic(goodsAttrDO.getAttrPic()); |
| | | orderGoodsDOList.add(orderGoodsDO); |
| | | //将商品金额计算到订单总金额 |
| | | orderTotal = orderTotal.add(orderGoodsDO.getGoodsAttrPrice().multiply(BigDecimal.valueOf(orderGoodsDO.getAmount()))); |
| | | } |
| | | } |
| | | //如果是购物车提交,需要将购物车内商品移除 |
| | | if(orderCreateDTO.getSubmitType().equals(ComShopOrderCreateDTO.submitType.cart)){ |
| | | comShopCartDAO.deleteBatchIds(orderCreateDTO.getCartIds()); |
| | | } |
| | | //创建订单信息 |
| | | ComShopOrderDO shopOrderDO = new ComShopOrderDO(); |
| | | shopOrderDO.setOrderNo(orderNo); |
| | | shopOrderDO.setStoreId(storeId); |
| | | shopOrderDO.setUserId(userId); |
| | | shopOrderDO.setStatus(ComShopOrderDO.status.dfk); |
| | | shopOrderDO.setPayStatus(ComShopOrderDO.payStatus.no); |
| | | shopOrderDO.setReceiverId(orderCreateDTO.getReceiverId()); |
| | | shopOrderDO.setDeleteStatus(ComShopOrderDO.deleteStatus.no); |
| | | shopOrderDO.setTotalAmount(orderTotal); |
| | | shopOrderDO.setDiscountAmount(BigDecimal.ZERO); |
| | | shopOrderDO.setDeliveryType(deliveryType); |
| | | if(StringUtils.isNotEmpty(orderCreateDTO.getRemark())){ |
| | | shopOrderDO.setRemark(orderCreateDTO.getRemark()); |
| | | } |
| | | this.baseMapper.insert(shopOrderDO); |
| | | if(!orderGoodsDOList.isEmpty()){ |
| | | orderGoodsDOList.forEach(orderGoods ->{ |
| | | orderGoods.setOrderId(shopOrderDO.getId()); |
| | | comShopOrderGoodsDAO.insert(orderGoods); |
| | | }); |
| | | } |
| | | //创建订单操作记录 |
| | | ComShopOrderOperateDO orderOperateDO = new ComShopOrderOperateDO(); |
| | | orderOperateDO.setOrderNo(orderNo); |
| | | orderOperateDO.setOperationType(ComShopOrderOperateDO.operationType.create); |
| | | orderOperateDO.setOperationTime(new Date()); |
| | | if(StringUtils.isNotEmpty(orderCreateDTO.getPhone())){ |
| | | orderOperateDO.setOperationContent("用户" + orderCreateDTO.getPhone() + "下单"); |
| | | orderOperateDO.setOperationBy("用户" + orderCreateDTO.getPhone()); |
| | | }else { |
| | | orderOperateDO.setOperationContent("用户下单"); |
| | | orderOperateDO.setOperationBy("用户"); |
| | | } |
| | | comShopOrderOperateDAO.insert(orderOperateDO); |
| | | shopOrderVO.setOrderNo(orderNo); |
| | | shopOrderVO.setOrderTotal(orderTotal); |
| | | shopOrderVO.setOrderId(shopOrderDO.getId()); |
| | | |
| | | try { |
| | | BigDecimal money = orderTotal; |
| | | if(isTest){ |
| | | money = BigDecimal.valueOf(0.01); |
| | | } |
| | | //调用wx支付 |
| | | String xml = WxPayUtils.getUnifiedorder(appid,mchId,payKey,notifyUrl,"商品购买",orderCreateDTO.getOpenId(),orderNo,money); |
| | | log.info("微信支付返回参数:" + xml); |
| | | shopOrderVO.setPayResult(xml); |
| | | }catch (Exception e){ |
| | | log.error("调用微信支付异常,异常原因:" + e.getMessage()); |
| | | } |
| | | return R.ok(shopOrderVO); |
| | | } |
| | | |
| | | /** |
| | | * 分页查询用户订单列表 |
| | | * @param comOrderListDTO 请求参数 |
| | | * @return 查询结果 |
| | | */ |
| | | @Override |
| | | public R pageOrderList(PageComOrderListDTO comOrderListDTO){ |
| | | Page page = new Page<>(comOrderListDTO.getPageNum(),comOrderListDTO.getPageSize()); |
| | | IPage<ComShopOrderPageVO> orderPageVOIPage = this.baseMapper.pageOrderList(page,comOrderListDTO); |
| | | if(!orderPageVOIPage.getRecords().isEmpty()){ |
| | | orderPageVOIPage.getRecords().forEach(orderVo -> { |
| | | List<ComShopOrderGoodsVO> orderGoodsVOS = new ArrayList<>(); |
| | | //查询订单下商品信息 |
| | | List<ComShopOrderGoodsDO> orderGoodsDOList = comShopOrderGoodsDAO.selectList(new QueryWrapper<ComShopOrderGoodsDO>() |
| | | .eq("order_no",orderVo.getOrderNo())); |
| | | if(!orderGoodsDOList.isEmpty()){ |
| | | orderGoodsDOList.forEach(orderGoods -> { |
| | | ComShopOrderGoodsVO orderGoodsVO = new ComShopOrderGoodsVO(); |
| | | BeanUtils.copyProperties(orderGoods,orderGoodsVO); |
| | | //根据商品规格id查询商品规格 |
| | | ComShopGoodsAttrDO goodsAttrDO = comShopGoodsAttrDAO.selectById(orderGoods.getGoodsAttrId()); |
| | | if(goodsAttrDO != null){ |
| | | orderGoodsVO.setGoodsAttr(goodsAttrDO.getGoodsAttr()); |
| | | } |
| | | orderGoodsVO.setNum(orderGoods.getAmount()); |
| | | orderGoodsVO.setGoodsPic(orderGoods.getGoodsAttrPic()); |
| | | orderGoodsVO.setPrice(orderGoods.getGoodsAttrPrice()); |
| | | orderGoodsVOS.add(orderGoodsVO); |
| | | }); |
| | | } |
| | | orderVo.setOrderGoodsVOList(orderGoodsVOS); |
| | | |
| | | PageShopStoreVO shopStoreVO = new PageShopStoreVO(); |
| | | //查询店铺信息 |
| | | ComShopStoreDO shopStoreDO = comShopStoreDAO.selectById(orderVo.getStoreId()); |
| | | if(shopStoreDO != null){ |
| | | BeanUtils.copyProperties(shopStoreDO,shopStoreVO); |
| | | } |
| | | orderVo.setShopStoreVO(shopStoreVO); |
| | | }); |
| | | } |
| | | return R.ok(orderPageVOIPage); |
| | | } |
| | | |
| | | /** |
| | | * 根据订单id查询订单详情 |
| | | * @param orderId 订单id |
| | | * @return 订单详情 |
| | | */ |
| | | @Override |
| | | public R orderDetail(Long orderId) { |
| | | |
| | | ComShopOrderPageVO orderVO = new ComShopOrderPageVO(); |
| | | //查询订单信息 |
| | | ComShopOrderDO shopOrderDO = this.baseMapper.selectById(orderId); |
| | | if(shopOrderDO == null){ |
| | | return R.fail("未查询到订单"); |
| | | } |
| | | BeanUtils.copyProperties(shopOrderDO,orderVO); |
| | | orderVO.setOrderTotal(shopOrderDO.getTotalAmount()); |
| | | |
| | | PageShopStoreVO shopStoreVO = new PageShopStoreVO(); |
| | | //查询店铺信息 |
| | | ComShopStoreDO shopStoreDO = comShopStoreDAO.selectById(shopOrderDO.getStoreId()); |
| | | if(shopStoreDO != null){ |
| | | BeanUtils.copyProperties(shopStoreDO,shopStoreVO); |
| | | } |
| | | orderVO.setShopStoreVO(shopStoreVO); |
| | | |
| | | List<ComShopOrderGoodsVO> orderGoodsVOS = new ArrayList<>(); |
| | | //查询订单下商品信息 |
| | | List<ComShopOrderGoodsDO> orderGoodsDOList = comShopOrderGoodsDAO.selectList(new QueryWrapper<ComShopOrderGoodsDO>() |
| | | .eq("order_no",shopOrderDO.getOrderNo())); |
| | | StringBuilder sbr = new StringBuilder(""); |
| | | if(!orderGoodsDOList.isEmpty()){ |
| | | orderGoodsDOList.forEach(orderGoods -> { |
| | | ComShopOrderGoodsVO orderGoodsVO = new ComShopOrderGoodsVO(); |
| | | BeanUtils.copyProperties(orderGoods,orderGoodsVO); |
| | | orderGoodsVO.setNum(orderGoods.getAmount()); |
| | | orderGoodsVO.setGoodsPic(orderGoods.getGoodsAttrPic()); |
| | | orderGoodsVO.setPrice(orderGoods.getGoodsAttrPrice()); |
| | | //根据商品规格id查询商品规格 |
| | | ComShopGoodsAttrDO goodsAttrDO = comShopGoodsAttrDAO.selectById(orderGoods.getGoodsAttrId()); |
| | | if(goodsAttrDO != null){ |
| | | orderGoodsVO.setGoodsAttr(goodsAttrDO.getGoodsAttr()); |
| | | } |
| | | orderGoodsVOS.add(orderGoodsVO); |
| | | sbr.append(orderGoods.getGoodsName() + " " ); |
| | | }); |
| | | } |
| | | orderVO.setOrderGoodsVOList(orderGoodsVOS); |
| | | orderVO.setGoodsName(sbr.toString()); |
| | | |
| | | ComShopUserAddressVO userAddressVO = new ComShopUserAddressVO(); |
| | | //查询用户收货地址 |
| | | ComShopUserAddressDO userAddressDO = comShopUserAddressDAO.selectById(shopOrderDO.getReceiverId()); |
| | | if(userAddressDO != null){ |
| | | BeanUtils.copyProperties(userAddressDO,userAddressVO); |
| | | orderVO.setUserAddressVO(userAddressVO); |
| | | } |
| | | |
| | | //操作日志 |
| | | List<ComShopOrderOperateDO> listOperLog = comShopOrderOperateDAO.selectList(new LambdaQueryWrapper<ComShopOrderOperateDO>().eq(ComShopOrderOperateDO::getOrderNo, shopOrderDO.getOrderNo())); |
| | | List<ComShopOrderOperateVO> listOperLogVO = new ArrayList<>(listOperLog.size()); |
| | | listOperLog.forEach(logDO ->{ |
| | | ComShopOrderOperateVO copyVO = new ComShopOrderOperateVO(); |
| | | BeanUtils.copyProperties(logDO,copyVO); |
| | | listOperLogVO.add(copyVO); |
| | | }); |
| | | orderVO.setLogs(listOperLogVO); |
| | | return R.ok(orderVO); |
| | | } |
| | | |
| | | /** |
| | | * 根据订单id取消订单 |
| | | * @param comShopOrderQueryDTO 订单信息 |
| | | * @return 取消结果 |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @Override |
| | | public R orderCancel(ComShopOrderQueryDTO comShopOrderQueryDTO){ |
| | | //查询订单 |
| | | ComShopOrderDO shopOrderDO = this.baseMapper.selectById(comShopOrderQueryDTO.getOrderId()); |
| | | if(shopOrderDO == null){ |
| | | return R.fail("未查询到订单"); |
| | | } |
| | | if(!shopOrderDO.getStatus().equals(ComShopOrderDO.status.dfk)){ |
| | | return R.fail("已支付订单不可取消"); |
| | | } |
| | | //取消订单 |
| | | shopOrderDO.setStatus(ComShopOrderDO.status.yqx); |
| | | if(this.baseMapper.updateById(shopOrderDO) > 0){ |
| | | //添加订单操作记录 |
| | | ComShopOrderOperateDO orderOperateDO = new ComShopOrderOperateDO(); |
| | | orderOperateDO.setOrderNo(shopOrderDO.getOrderNo()); |
| | | orderOperateDO.setOperationType(ComShopOrderOperateDO.operationType.cancel); |
| | | orderOperateDO.setOperationTime(new Date()); |
| | | if(comShopOrderQueryDTO.getIsAdmin()){ |
| | | orderOperateDO.setOperationContent("管理员" + comShopOrderQueryDTO.getOperUserAccount() + "取消订单"); |
| | | orderOperateDO.setOperationBy("用户" + comShopOrderQueryDTO.getOperUserAccount()); |
| | | }else { |
| | | orderOperateDO.setOperationContent("用户取消订单"); |
| | | orderOperateDO.setOperationBy("用户"); |
| | | } |
| | | comShopOrderOperateDAO.insert(orderOperateDO); |
| | | return R.ok(); |
| | | }else{ |
| | | return R.fail("取消订单失败"); |
| | | } |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 根据订单id删除订单 |
| | | * @param orderId 订单id |
| | | * @return 删除结果 |
| | | */ |
| | | @Override |
| | | public R orderDelete(Long orderId){ |
| | | //查询订单 |
| | | ComShopOrderDO shopOrderDO = this.baseMapper.selectById(orderId); |
| | | if(shopOrderDO == null){ |
| | | return R.fail("未查询到订单"); |
| | | } |
| | | if(!shopOrderDO.getStatus().equals(ComShopOrderDO.status.ywc) && !shopOrderDO.getStatus().equals(ComShopOrderDO.status.yqx)){ |
| | | return R.fail("该订单状态不可删除"); |
| | | } |
| | | |
| | | shopOrderDO.setDeleteStatus(ComShopOrderDO.deleteStatus.yes); |
| | | if(this.baseMapper.updateById(shopOrderDO) > 0){ |
| | | return R.ok(); |
| | | }else{ |
| | | return R.fail("取消订单失败"); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 根据订单id确认收货 |
| | | * @param orderId 订单id |
| | | * @param phone 手机号 |
| | | * @return 确认结果 |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @Override |
| | | public R orderConfirm(Long orderId, String phone){ |
| | | //查询订单 |
| | | ComShopOrderDO shopOrderDO = this.baseMapper.selectById(orderId); |
| | | if(shopOrderDO == null){ |
| | | return R.fail("未查询到订单"); |
| | | } |
| | | if(!shopOrderDO.getStatus().equals(ComShopOrderDO.status.dsh)){ |
| | | return R.fail("该订单状态不可确认收货"); |
| | | } |
| | | //订单确认收货 |
| | | shopOrderDO.setStatus(ComShopOrderDO.status.ywc); |
| | | if(this.baseMapper.updateById(shopOrderDO) > 0){ |
| | | //添加订单操作记录 |
| | | ComShopOrderOperateDO orderOperateDO = new ComShopOrderOperateDO(); |
| | | orderOperateDO.setOrderNo(shopOrderDO.getOrderNo()); |
| | | orderOperateDO.setOperationType(ComShopOrderOperateDO.operationType.complete); |
| | | orderOperateDO.setOperationTime(new Date()); |
| | | if(StringUtils.isNotEmpty(phone)){ |
| | | orderOperateDO.setOperationContent("用户" + phone + "确认收货"); |
| | | orderOperateDO.setOperationBy("用户" + phone); |
| | | }else { |
| | | orderOperateDO.setOperationContent("用户确认收货"); |
| | | orderOperateDO.setOperationBy("用户"); |
| | | } |
| | | comShopOrderOperateDAO.insert(orderOperateDO); |
| | | return R.ok(); |
| | | }else{ |
| | | return R.fail("确认收货失败"); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 统计用户订单数量 |
| | | * @param userId 用户id |
| | | * @return 统计结果 |
| | | */ |
| | | @Override |
| | | public R orderStatistics(Long userId){ |
| | | OrderStatisticsVO orderStatisticsVO = new OrderStatisticsVO(); |
| | | //待付款订单数 |
| | | Integer paymentNum = 0; |
| | | //待发货订单数 |
| | | Integer deliverNum = 0; |
| | | //待收货订单数 |
| | | Integer receivingNum = 0; |
| | | List<ComShopOrderDO> shopOrderList = this.baseMapper.selectList(new QueryWrapper<ComShopOrderDO>() |
| | | .eq("user_id",userId).eq("delete_status",ComShopOrderDO.deleteStatus.no)); |
| | | if(!shopOrderList.isEmpty()){ |
| | | for (ComShopOrderDO orderDO:shopOrderList) { |
| | | if(orderDO.getStatus().equals(ComShopOrderDO.status.dfk)){ |
| | | paymentNum++; |
| | | }else if(orderDO.getStatus().equals(ComShopOrderDO.status.dfh)){ |
| | | deliverNum++; |
| | | }else if(orderDO.getStatus().equals(ComShopOrderDO.status.dsh)){ |
| | | receivingNum++; |
| | | } |
| | | } |
| | | } |
| | | orderStatisticsVO.setPaymentNum(paymentNum); |
| | | orderStatisticsVO.setDeliverNum(deliverNum); |
| | | orderStatisticsVO.setReceivingNum(receivingNum); |
| | | return R.ok(orderStatisticsVO); |
| | | } |
| | | |
| | | @Override |
| | | public R shipOrder(ComShopOrderShipDTO orderShipDTO) { |
| | | ComShopOrderDO comShopOrderDO = comShopOrderDAO.selectById(orderShipDTO.getOrderId()); |
| | | if(comShopOrderDO==null){ |
| | | return R.fail("订单不存在"); |
| | | } |
| | | if(!(comShopOrderDO.getStatus()==2) |
| | | || !(comShopOrderDO.getDeliveryStatus()==1)){ |
| | | return R.fail("订单发货失败,订单状态不允许发货"); |
| | | } |
| | | |
| | | ComShopStoreDO storeDO = comShopStoreDAO.selectById(comShopOrderDO.getStoreId()); |
| | | if(storeDO.getDeliveryType()!=2){ |
| | | return R.fail("该商家不支持通过快递物流发货"); |
| | | } |
| | | comShopOrderDO.setDeliveryStatus(2); |
| | | comShopOrderDO.setDeliveryType(2); |
| | | comShopOrderDO.setStatus(3); |
| | | comShopOrderDO.setLogisticsCompany(orderShipDTO.getLogisticsCompany()); |
| | | comShopOrderDO.setLogisticsNo(orderShipDTO.getLogisticsNo()); |
| | | int updated = comShopOrderDAO.updateById(comShopOrderDO); |
| | | if(updated==1){ |
| | | //创建订单操作记录 |
| | | ComShopOrderOperateDO orderOperateDO = new ComShopOrderOperateDO(); |
| | | orderOperateDO.setOrderNo(comShopOrderDO.getOrderNo()); |
| | | orderOperateDO.setOperationType(ComShopOrderOperateDO.operationType.deliver); |
| | | orderOperateDO.setOperationTime(new Date()); |
| | | if(orderShipDTO.getIsAdmin()){ |
| | | orderOperateDO.setOperationContent(orderShipDTO.getOperUserAccount()+"已发货"); |
| | | orderOperateDO.setOperationBy(orderShipDTO.getOperUserAccount()); |
| | | }else { |
| | | orderOperateDO.setOperationContent(orderShipDTO.getOperUserAccount() + "已发货"); |
| | | orderOperateDO.setOperationBy(orderShipDTO.getOperUserAccount()); |
| | | } |
| | | int inserted = comShopOrderOperateDAO.insert(orderOperateDO); |
| | | if(inserted!=1){ |
| | | log.error("订单发货日志保存错误"); |
| | | } |
| | | return R.ok("发货成功"); |
| | | } |
| | | return R.fail("发货失败!"); |
| | | } |
| | | |
| | | @Override |
| | | public R deliverOrder(ComShopOrderDeliverDTO orderDeliverDTO) { |
| | | ComShopOrderDO comShopOrderDO = comShopOrderDAO.selectById(orderDeliverDTO.getOrderId()); |
| | | if(comShopOrderDO==null){ |
| | | return R.fail("订单不存在"); |
| | | } |
| | | if(!(comShopOrderDO.getStatus()==2) |
| | | || !(comShopOrderDO.getDeliveryStatus()==1)){ |
| | | return R.fail("当前订单不能配送"); |
| | | } |
| | | ComShopStoreDO storeDO = comShopStoreDAO.selectById(comShopOrderDO.getStoreId()); |
| | | if(storeDO.getDeliveryType()!=1){ |
| | | return R.fail("该商家不支持通过商家配送"); |
| | | } |
| | | comShopOrderDO.setDeliveryStatus(4); |
| | | comShopOrderDO.setDeliveryType(1); |
| | | comShopOrderDO.setStatus(3); |
| | | int updated = comShopOrderDAO.updateById(comShopOrderDO); |
| | | if(updated==1){ |
| | | |
| | | //创建订单操作记录 |
| | | ComShopOrderOperateDO orderOperateDO = new ComShopOrderOperateDO(); |
| | | orderOperateDO.setOrderNo(comShopOrderDO.getOrderNo()); |
| | | orderOperateDO.setOperationType(ComShopOrderOperateDO.operationType.deliver); |
| | | orderOperateDO.setOperationTime(new Date()); |
| | | if(orderDeliverDTO.getIsAdmin()){ |
| | | orderOperateDO.setOperationContent(orderDeliverDTO.getOperUserAccount() + "已发货"); |
| | | orderOperateDO.setOperationBy(orderDeliverDTO.getOperUserAccount()); |
| | | }else { |
| | | orderOperateDO.setOperationContent(orderDeliverDTO.getOperUserAccount() + "已发货"); |
| | | orderOperateDO.setOperationBy(orderDeliverDTO.getOperUserAccount()); |
| | | } |
| | | int inserted = comShopOrderOperateDAO.insert(orderOperateDO); |
| | | if(inserted!=1){ |
| | | log.error("订单发货日志保存错误"); |
| | | } |
| | | return R.ok("开始配送"); |
| | | } |
| | | return R.fail("操作失败!"); |
| | | } |
| | | |
| | | @Override |
| | | public R finishDeliverOrder(ComShopOrderDeliverDTO orderDeliverDTO) { |
| | | ComShopOrderDO comShopOrderDO = comShopOrderDAO.selectById(orderDeliverDTO.getOrderId()); |
| | | if(comShopOrderDO==null){ |
| | | return R.fail("订单不存在"); |
| | | } |
| | | if(comShopOrderDO.getDeliveryStatus() != 4 && comShopOrderDO.getDeliveryStatus() != 3){ |
| | | return R.fail("订单还未开始配送"); |
| | | } |
| | | if(!(comShopOrderDO.getStatus() == 3)){ |
| | | return R.fail("订单还未发货"); |
| | | } |
| | | //comShopOrderDO.setStatus(4); |
| | | comShopOrderDO.setDeliveryStatus(5); |
| | | int updated = comShopOrderDAO.updateById(comShopOrderDO); |
| | | if(updated==1){ |
| | | //创建订单操作记录 |
| | | ComShopOrderOperateDO orderOperateDO = new ComShopOrderOperateDO(); |
| | | orderOperateDO.setOrderNo(comShopOrderDO.getOrderNo()); |
| | | orderOperateDO.setOperationType(ComShopOrderOperateDO.operationType.complete); |
| | | orderOperateDO.setOperationTime(new Date()); |
| | | if(orderDeliverDTO.getIsAdmin()){ |
| | | orderOperateDO.setOperationContent("订单已完成"); |
| | | orderOperateDO.setOperationBy(orderDeliverDTO.getOperUserAccount()); |
| | | }else { |
| | | orderOperateDO.setOperationContent("订单已完成"); |
| | | orderOperateDO.setOperationBy(orderDeliverDTO.getOperUserAccount()); |
| | | } |
| | | int inserted = comShopOrderOperateDAO.insert(orderOperateDO); |
| | | if(inserted!=1){ |
| | | log.error("订单发货日志保存错误"); |
| | | } |
| | | return R.ok("配送完成"); |
| | | } |
| | | return R.fail("操作失败!"); |
| | | } |
| | | |
| | | @Override |
| | | public R shopOrderExportData(ComShopOrderExportDTO comShopOrderExportDTO) { |
| | | Page page = new Page(); |
| | | page.setSize(10000); |
| | | page.setCurrent(1); |
| | | IPage<ExcelShopOrderDTO> excelShopOrderDTO = comShopOrderDAO.selectOrderExport(page, comShopOrderExportDTO); |
| | | return R.ok(excelShopOrderDTO.getRecords()); |
| | | } |
| | | |
| | | @Override |
| | | public R shopOrderFundsExportData(ComShopFundsExportDTO comShopFundsExportDTO) { |
| | | Page page = new Page(); |
| | | page.setSize(10000); |
| | | page.setCurrent(1); |
| | | IPage<ExcelShopFundsDTO> excelShopFundsDTO = comShopOrderDAO.selectFundsExport(page, comShopFundsExportDTO); |
| | | return R.ok(excelShopFundsDTO.getRecords()); |
| | | } |
| | | |
| | | @Override |
| | | public R getFundsStat(Long userId) { |
| | | ComShopFundsVO comShopFundsVO = comShopOrderDAO.queryStatis(userId); |
| | | if(comShopFundsVO==null){ |
| | | comShopFundsVO = new ComShopFundsVO(); |
| | | comShopFundsVO.setMonthTotal(new BigDecimal(0)); |
| | | comShopFundsVO.setTodayTotal(new BigDecimal(0)); |
| | | comShopFundsVO.setWeekTotal(new BigDecimal(0)); |
| | | } |
| | | return R.ok(comShopFundsVO); |
| | | } |
| | | |
| | | @Override |
| | | public R pageShopFunds(PageComShopFundsSearchDTO pageComShopFundsSearchDTO) { |
| | | Long pageNum = pageComShopFundsSearchDTO.getPageNum(); |
| | | Long pageSize = pageComShopFundsSearchDTO.getPageSize(); |
| | | Page page = new Page(); |
| | | if(pageNum==null||0==pageNum.longValue()){ |
| | | pageNum = 1l; |
| | | } |
| | | if(pageSize==null||0==pageSize.longValue()){ |
| | | pageSize = 10l; |
| | | } |
| | | page.setCurrent(pageNum); |
| | | page.setSize(pageSize); |
| | | IPage<ComShopFundsOrderVO> comShopFundsOrderVOIPage = comShopOrderDAO.pageShopFunds(page, pageComShopFundsSearchDTO); |
| | | return R.ok(comShopFundsOrderVOIPage); |
| | | } |
| | | |
| | | @Override |
| | | public R pageShopOrder(PageComShopOrderSearchDTO pageComShopOrderSearchDTO) { |
| | | Long pageNum = pageComShopOrderSearchDTO.getPageNum(); |
| | | Long pageSize = pageComShopOrderSearchDTO.getPageSize(); |
| | | Page page = new Page(); |
| | | |
| | | page.setCurrent(pageNum); |
| | | page.setSize(pageSize); |
| | | if(pageNum==null||0==pageNum.longValue()){ |
| | | page.setCurrent(1l); |
| | | } |
| | | if(pageSize==null||0==pageSize.longValue()){ |
| | | page.setSize(10l); |
| | | } |
| | | |
| | | IPage<ComShopOrderSearchVO> ipage = this.baseMapper.pageOrderBy(page, pageComShopOrderSearchDTO); |
| | | return R.ok(ipage); |
| | | } |
| | | |
| | | @Override |
| | | public R capitalDetailByStore(Long id) { |
| | | if(id==null){ |
| | | R.fail("订单号不能为空!"); |
| | | } |
| | | CapitalDetailVO vo = this.baseMapper.capitalDetailByStore(id); |
| | | return R.ok(vo); |
| | | } |
| | | |
| | | /** |
| | | * 微信支付订单回调 |
| | | * @param wxPayNotifyOrderDTO 订单支付回调参数 |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @Override |
| | | public void wxOrderPayNotify(WxPayNotifyOrderDTO wxPayNotifyOrderDTO){ |
| | | log.info("微信订单支付回调开始处理逻辑"); |
| | | if(StringUtils.isEmpty(wxPayNotifyOrderDTO.getOrderTradeNo())){ |
| | | log.error("微信支付回调失败,订单号为空"); |
| | | return; |
| | | } |
| | | |
| | | log.info("微信订单支付回调开始查询订单"); |
| | | //查询订单 |
| | | ComShopOrderDO shopOrderDO = this.baseMapper.selectOne(new QueryWrapper<ComShopOrderDO>().lambda().eq(ComShopOrderDO::getOrderNo,wxPayNotifyOrderDTO.getOrderTradeNo())); |
| | | if(shopOrderDO == null){ |
| | | log.error("未查询到支付订单,订单回调失败,订单号:" + wxPayNotifyOrderDTO.getOrderTradeNo()); |
| | | return; |
| | | } |
| | | shopOrderDO.setStatus(ComShopOrderDO.status.dfh); |
| | | shopOrderDO.setPayType(ComShopOrderDO.payType.wx); |
| | | shopOrderDO.setPayStatus(ComShopOrderDO.payStatus.yes); |
| | | shopOrderDO.setPayAmount(BigDecimal.valueOf(Double.valueOf(wxPayNotifyOrderDTO.getCashFee()) / 100)); |
| | | shopOrderDO.setWxTardeNo(wxPayNotifyOrderDTO.getWxTradeNo()); |
| | | shopOrderDO.setPayTime(DateUtils.stringToDate(wxPayNotifyOrderDTO.getPayTime(),new SimpleDateFormat("yyyyMMddHHmmss"))); |
| | | this.baseMapper.updateById(shopOrderDO); |
| | | |
| | | //查询订单商品 |
| | | List<ComShopOrderGoodsDO> orderGoodsList = comShopOrderGoodsDAO.selectList(new QueryWrapper<ComShopOrderGoodsDO>().lambda().eq(ComShopOrderGoodsDO ::getOrderNo,shopOrderDO.getOrderNo())); |
| | | if(!orderGoodsList.isEmpty()){ |
| | | int goodsNub = 0; |
| | | for (ComShopOrderGoodsDO orderGood:orderGoodsList) { |
| | | goodsNub += orderGood.getAmount(); |
| | | //更新商品信息 |
| | | ComShopGoodsDO goodsDO = comShopGoodsDAO.selectById(orderGood.getGoodsId()); |
| | | if(goodsDO != null){ |
| | | goodsDO.setSale(goodsDO.getSale() + orderGood.getAmount()); |
| | | comShopGoodsDAO.updateById(goodsDO); |
| | | } |
| | | |
| | | //更新商品规格 |
| | | ComShopGoodsAttrDO goodsAttrDO = comShopGoodsAttrDAO.selectById(orderGood.getGoodsAttrId()); |
| | | if(goodsAttrDO != null){ |
| | | goodsAttrDO.setSale(goodsAttrDO.getSale() + orderGood.getAmount()); |
| | | comShopGoodsAttrDAO.updateById(goodsAttrDO); |
| | | } |
| | | } |
| | | |
| | | //更新店铺销量以及销售额 |
| | | ComShopStoreDO storeDO = comShopStoreDAO.selectById(shopOrderDO.getStoreId()); |
| | | if(storeDO != null){ |
| | | storeDO.setSale(storeDO.getSale() + goodsNub); |
| | | storeDO.setSaleVolume(storeDO.getSaleVolume().add(shopOrderDO.getTotalAmount())); |
| | | comShopStoreDAO.updateById(storeDO); |
| | | } |
| | | } |
| | | |
| | | //添加订单操作记录 |
| | | ComShopOrderOperateDO orderOperateDO = new ComShopOrderOperateDO(); |
| | | orderOperateDO.setOrderNo(shopOrderDO.getOrderNo()); |
| | | orderOperateDO.setOperationType(ComShopOrderOperateDO.operationType.pay); |
| | | orderOperateDO.setOperationTime(new Date()); |
| | | orderOperateDO.setOperationContent("用户支付订单"); |
| | | orderOperateDO.setOperationBy("用户"); |
| | | comShopOrderOperateDAO.insert(orderOperateDO); |
| | | |
| | | //添加订单支付记录表 |
| | | ComShopOrderPayDO orderPayDO = new ComShopOrderPayDO(); |
| | | orderPayDO.setOrderNo(shopOrderDO.getOrderNo()); |
| | | orderPayDO.setOrderAmount(shopOrderDO.getTotalAmount()); |
| | | orderPayDO.setWxTradeNo(wxPayNotifyOrderDTO.getWxTradeNo()); |
| | | orderPayDO.setPayStatus(ComShopOrderPayDO.payStatus.yes); |
| | | orderPayDO.setPayAmount(shopOrderDO.getPayAmount()); |
| | | orderPayDO.setPayTime(shopOrderDO.getPayTime()); |
| | | comShopOrderPayDAO.insert(orderPayDO); |
| | | } |
| | | |
| | | /** |
| | | * 订单去支付 |
| | | * @param orderPayDTO 请求参数 |
| | | * @return 支付对象 |
| | | */ |
| | | public R wxPay(OrderPayDTO orderPayDTO){ |
| | | //创建返回参数 |
| | | ComShopOrderVO shopOrderVO = new ComShopOrderVO(); |
| | | //查询订单 |
| | | ComShopOrderDO orderDO = comShopOrderDAO.selectOne(new QueryWrapper<ComShopOrderDO>().lambda().eq(ComShopOrderDO::getOrderNo,orderPayDTO.getOrderNo())); |
| | | if(orderDO == null){ |
| | | return R.fail("订单不存在"); |
| | | } |
| | | try { |
| | | BigDecimal money = orderDO.getTotalAmount(); |
| | | if(isTest){ |
| | | money = BigDecimal.valueOf(0.01); |
| | | } |
| | | //调用wx支付 |
| | | String xml = WxPayUtils.getUnifiedorder(appid,mchId,payKey,notifyUrl,"商品购买",orderPayDTO.getOpenId(),orderDO.getOrderNo(),money); |
| | | log.info("微信支付返回参数:" + xml); |
| | | shopOrderVO.setPayResult(xml); |
| | | }catch (Exception e){ |
| | | log.error("调用微信支付异常,异常原因:" + e.getMessage()); |
| | | } |
| | | shopOrderVO.setOrderId(orderDO.getId()); |
| | | shopOrderVO.setOrderNo(orderDO.getOrderNo()); |
| | | shopOrderVO.setOrderTotal(orderDO.getTotalAmount()); |
| | | return R.ok(shopOrderVO); |
| | | } |
| | | |
| | | public static void main(String[] args) { |
| | | BigDecimal one = BigDecimal.valueOf(Double.valueOf("1") / 100); |
| | | System.out.println(); |
| | | } |
| | | } |
| | |
| | | package com.panzhihua.service_community.service.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.panzhihua.common.model.dtos.shop.PageComShopGoodsDTO; |
| | | import com.panzhihua.common.constants.Constants; |
| | | import com.panzhihua.common.model.dtos.shop.PageComShopStoreDTO; |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.shop.ComShopStoreVO; |
| | | import com.panzhihua.common.model.vos.shop.ShopGoodsVO; |
| | | import com.panzhihua.common.model.vos.shop.ShopStoreVO; |
| | | import com.panzhihua.common.model.vos.shop.*; |
| | | import com.panzhihua.common.model.vos.shop.PageShopStoreVO; |
| | | import com.panzhihua.common.service.user.UserService; |
| | | import com.panzhihua.service_community.dao.ComShopGoodsAttrDAO; |
| | | import com.panzhihua.service_community.dao.ComShopGoodsDAO; |
| | | import com.panzhihua.service_community.dao.ComShopStoreDAO; |
| | | import com.panzhihua.service_community.model.dos.ComShopGoodsAttrDO; |
| | | import com.panzhihua.service_community.model.dos.ComShopGoodsDO; |
| | | import com.panzhihua.service_community.model.dos.ComShopOrderDO; |
| | | import com.panzhihua.service_community.model.dos.ComShopStoreDO; |
| | | import com.panzhihua.service_community.service.ComShopOrderService; |
| | | import com.panzhihua.service_community.service.ComShopStoreService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Optional; |
| | | import java.util.stream.Collectors; |
| | | import java.util.stream.Stream; |
| | | |
| | | /** |
| | | * @auther lyq |
| | |
| | | @Slf4j |
| | | @Service |
| | | public class ComShopStoreServiceImpl extends ServiceImpl<ComShopStoreDAO, ComShopStoreDO> implements ComShopStoreService { |
| | | |
| | | @Resource |
| | | private ComShopGoodsDAO shopGoodsDAO; |
| | | @Resource |
| | | private ComShopGoodsAttrDAO comShopGoodsAttrDAO; |
| | | @Resource |
| | | private ComShopOrderService orderService; |
| | | @Resource |
| | | private UserService userService; |
| | | /** |
| | | * 查询店铺列表 |
| | | * |
| | | * @param pageComShopStoreDTO 请求参数 |
| | | * @return 店铺列表 |
| | | */ |
| | | |
| | | @Override |
| | | public R pageStoreList(PageComShopStoreDTO pageComShopStoreDTO) { |
| | | Page page = new Page<>(pageComShopStoreDTO.getPageNum(), pageComShopStoreDTO.getPageSize()); |
| | | IPage<ComShopStoreVO> comShopStoreVOIPage = this.baseMapper.pageShopStore(page, pageComShopStoreDTO); |
| | | IPage<PageShopStoreVO> comShopStoreVOIPage = this.baseMapper.pageShopStore(page, pageComShopStoreDTO); |
| | | if(comShopStoreVOIPage!=null){ |
| | | Optional.ofNullable(comShopStoreVOIPage.getRecords()).orElse(new ArrayList<>()).forEach(shopStoreVO ->{ |
| | | List<Integer> notDoneOrderStatus = new ArrayList<>(); |
| | | notDoneOrderStatus.add(1); |
| | | notDoneOrderStatus.add(2); |
| | | notDoneOrderStatus.add(3); |
| | | notDoneOrderStatus.add(4); |
| | | Integer orderCount = orderService.getBaseMapper() |
| | | .selectCount(new LambdaQueryWrapper<ComShopOrderDO>() |
| | | .eq(ComShopOrderDO::getStoreId, shopStoreVO.getId()) |
| | | .eq(ComShopOrderDO::getDeleteStatus, 1) |
| | | .in(ComShopOrderDO::getStatus, notDoneOrderStatus) |
| | | ); |
| | | if(orderCount==null || orderCount.intValue() <= 0){ |
| | | shopStoreVO.setOrderDone(true); |
| | | }else{ |
| | | shopStoreVO.setOrderDone(false); |
| | | } |
| | | }); |
| | | } |
| | | return R.ok(comShopStoreVOIPage); |
| | | } |
| | | |
| | | /** |
| | | * 查询店铺详情 |
| | | * |
| | | * @param comShopStoreDTO 请求参数 |
| | | * @return 店铺详情 |
| | | */ |
| | | @Override |
| | | public R shopStoreDetail(PageComShopStoreDTO comShopStoreDTO) { |
| | | //查询店铺 |
| | | ComShopStoreDO storeDO = this.baseMapper.selectById(comShopStoreDTO.getStoreId()); |
| | | if (storeDO == null) { |
| | | return R.fail(401, "店铺不存在"); |
| | | } |
| | | if (storeDO.getStatus().equals(ComShopStoreDO.status.no)) { |
| | | return R.fail(402, "店铺已被禁用"); |
| | | } |
| | | PageShopStoreVO shopStoreVO = new PageShopStoreVO(); |
| | | BeanUtils.copyProperties(storeDO, shopStoreVO); |
| | | |
| | | //查询店铺下商品信息 |
| | | Page page = new Page<>(comShopStoreDTO.getPageNum(), comShopStoreDTO.getPageSize()); |
| | | |
| | | List<ComShopGoodsVO> goodsList = shopGoodsDAO.pageShopGoodsByStoreId(page, comShopStoreDTO).getRecords(); |
| | | if(!goodsList.isEmpty()){ |
| | | //查询商品规格列表 |
| | | goodsList.forEach(goods -> { |
| | | List<ComShopGoodsAttrVO> goodsAttrList = comShopGoodsAttrDAO.getGoodsAttr(goods.getId()); |
| | | if(!goodsAttrList.isEmpty()){ |
| | | goods.setGoodsAttrList(goodsAttrList); |
| | | } |
| | | }); |
| | | } |
| | | shopStoreVO.setGoodsList(goodsList); |
| | | return R.ok(shopStoreVO); |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public R saveStore(ShopStoreVO storeVO) { |
| | | if (storeVO == null) { |
| | | return R.ok("500", "数据为空!"); |
| | | return R.fail("数据为空!"); |
| | | } |
| | | //判断店铺是否存在 |
| | | ComShopStoreDO oldComShopStoreDO = this.baseMapper.selectOne(new LambdaQueryWrapper<ComShopStoreDO>() |
| | | .eq(ComShopStoreDO::getStoreAccount, storeVO.getStoreAccount()).eq(ComShopStoreDO::getDeleteStatus,ComShopStoreDO.deleteStatus.no)); |
| | | if (oldComShopStoreDO != null) { |
| | | return R.fail("商家已注册"); |
| | | } |
| | | // //新增店铺先判断是否拥有已删除的店铺 |
| | | // ComShopStoreDO comShopStoreDO = this.baseMapper.selectOne(new LambdaQueryWrapper<ComShopStoreDO>() |
| | | // .eq(ComShopStoreDO::getStoreAccount, storeVO.getStoreAccount()).eq(ComShopStoreDO::getDeleteStatus,ComShopStoreDO.deleteStatus.yes)); |
| | | // if(comShopStoreDO != null){ |
| | | // //删除店铺规格信息 |
| | | // comShopGoodsAttrDAO.delete(new QueryWrapper<ComShopGoodsAttrDO>().lambda().eq(ComShopGoodsAttrDO::getStoreId,comShopStoreDO.getId())); |
| | | // //删除店铺商品 |
| | | // shopGoodsDAO.delete(new QueryWrapper<ComShopGoodsDO>().lambda().eq(ComShopGoodsDO::getStoreId,comShopStoreDO.getId())); |
| | | // //删除关联的sysUser用户权限 |
| | | // this.baseMapper.deleteSysRoleByAccount(Constants.SHOP_ROLE_KEY + comShopStoreDO.getStoreAccount()); |
| | | // //删除关联的sysUser用户 |
| | | // this.baseMapper.deleteSysUserBySysUserId(comShopStoreDO.getSysUserId()); |
| | | // //删除店铺 |
| | | // this.baseMapper.deleteById(comShopStoreDO.getId()); |
| | | // } |
| | | ComShopStoreDO storeDO = new ComShopStoreDO(); |
| | | BeanUtils.copyProperties(storeVO, storeDO); |
| | | storeDO.setSale(0); |
| | |
| | | return R.ok(); |
| | | } |
| | | |
| | | @Override |
| | | public R editStore(Long id, ShopStoreVO storeVO) { |
| | | if (storeVO == null) { |
| | | return R.ok("500", "数据为空!"); |
| | | public R addStore(ShopStoreVO storeVO){ |
| | | //判断店铺是否存在 |
| | | ComShopStoreDO oldComShopStoreDO = this.baseMapper.selectOne(new LambdaQueryWrapper<ComShopStoreDO>() |
| | | .eq(ComShopStoreDO::getStoreAccount, storeVO.getStoreAccount()).eq(ComShopStoreDO::getDeleteStatus, ComShopStoreDO.deleteStatus.no)); |
| | | if (oldComShopStoreDO != null) { |
| | | return R.fail("商家账号已注册"); |
| | | } |
| | | LambdaQueryWrapper<ComShopStoreDO> query = new LambdaQueryWrapper<ComShopStoreDO>().eq(ComShopStoreDO::getId, id); |
| | | int reasonable1 = this.baseMapper.reasonableUserByPhone(storeVO.getPhone()); |
| | | int reasonable2 = this.baseMapper.reasonableUserByAccount(storeVO.getStoreAccount()); |
| | | if (reasonable1 > 0) { |
| | | return R.fail("手机号:" + storeVO.getPhone() + "在系统用户中已存在"); |
| | | } |
| | | if (reasonable2 > 0) { |
| | | return R.fail("账号:" + storeVO.getStoreAccount() + "在系统用户中已存在"); |
| | | } |
| | | //新增店铺先判断是否拥有已删除的店铺 |
| | | ComShopStoreDO comShopStoreDO = this.baseMapper.selectOne(new LambdaQueryWrapper<ComShopStoreDO>() |
| | | .eq(ComShopStoreDO::getStoreAccount, storeVO.getStoreAccount()).eq(ComShopStoreDO::getDeleteStatus, ComShopStoreDO.deleteStatus.yes)); |
| | | if (comShopStoreDO != null) { |
| | | //删除店铺规格信息 |
| | | comShopGoodsAttrDAO.delete(new QueryWrapper<ComShopGoodsAttrDO>().lambda().eq(ComShopGoodsAttrDO::getStoreId, comShopStoreDO.getId())); |
| | | //删除店铺商品 |
| | | shopGoodsDAO.delete(new QueryWrapper<ComShopGoodsDO>().lambda().eq(ComShopGoodsDO::getStoreId, comShopStoreDO.getId())); |
| | | //删除关联的sysUser用户权限 |
| | | this.baseMapper.deleteSysRoleByAccount(Constants.SHOP_ROLE_KEY + comShopStoreDO.getStoreAccount()); |
| | | //删除关联的sysUser用户 |
| | | this.baseMapper.deleteSysUserBySysUserId(comShopStoreDO.getSysUserId()); |
| | | //删除店铺 |
| | | this.baseMapper.deleteById(comShopStoreDO.getId()); |
| | | } |
| | | ComShopStoreDO storeDO = new ComShopStoreDO(); |
| | | BeanUtils.copyProperties(storeVO, storeDO); |
| | | int update = this.baseMapper.update(storeDO, query); |
| | | return update > 0 ? R.ok() : R.fail(); |
| | | storeDO.setSale(0); |
| | | if(this.baseMapper.insert(storeDO) > 0){ |
| | | return R.ok(); |
| | | }else{ |
| | | return R.fail(); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public R editStore(Long id, ShopStoreVO storeVO) { |
| | | ComShopStoreDO storeDO = this.baseMapper.selectById(id); |
| | | if(storeDO == null){ |
| | | return R.fail("商家不存在"); |
| | | } |
| | | BeanUtils.copyProperties(storeVO, storeDO); |
| | | if(this.baseMapper.updateById(storeDO) > 0){ |
| | | return R.ok(); |
| | | }else{ |
| | | return R.fail(); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public R deleteStore(Long[] id) { |
| | | ComShopStoreDO storeDO = new ComShopStoreDO(); |
| | | storeDO.setDeleteStatus(2); |
| | | LambdaQueryWrapper<ComShopStoreDO> query = new LambdaQueryWrapper<ComShopStoreDO>().eq(ComShopStoreDO::getId, id); |
| | | int update = this.baseMapper.update(storeDO, query); |
| | | return update > 0 ? R.ok() : R.fail(); |
| | | LambdaQueryWrapper<ComShopStoreDO> query = new LambdaQueryWrapper<ComShopStoreDO>().in(ComShopStoreDO::getId, id); |
| | | List<ComShopStoreDO> comShopStoreDO = this.baseMapper.selectList(query); |
| | | if(!comShopStoreDO.isEmpty()){ |
| | | for (ComShopStoreDO shopStoreDO:comShopStoreDO) { |
| | | //判断店铺下是否拥有正常的商品 |
| | | List<ComShopGoodsDO> shopGoodsList = shopGoodsDAO.selectList(new QueryWrapper<ComShopGoodsDO>() |
| | | .lambda().eq(ComShopGoodsDO::getStoreId,shopStoreDO.getId()) |
| | | .eq(ComShopGoodsDO::getDeleteStatus,ComShopGoodsDO.deleteStatus.no) |
| | | .eq(ComShopGoodsDO::getStatus,ComShopGoodsDO.status.sell)); |
| | | if(!shopGoodsList.isEmpty()){//如果有正常商品则提示无法删除 |
| | | return R.fail("店铺下有商品正在出售,无法删除店铺"); |
| | | } |
| | | List<ComShopOrderDO> comShopOrderDOS = orderService.getBaseMapper().selectList(new LambdaQueryWrapper<ComShopOrderDO>() |
| | | .eq(ComShopOrderDO::getStoreId,shopStoreDO.getId())); |
| | | List<ComShopOrderDO> filterOrder = comShopOrderDOS.stream() |
| | | .filter(order -> order.getStatus() < ComShopOrderDO.status.dpj) |
| | | .collect(Collectors.toList()); |
| | | if(!filterOrder.isEmpty()){ |
| | | return R.fail("该商家还有订单未完成,不能删除"); |
| | | } |
| | | //删除商家下的订单 |
| | | comShopOrderDOS.forEach(order->{ |
| | | order.setDeleteStatus(ComShopOrderDO.deleteStatus.yes); |
| | | orderService.getBaseMapper().updateById(order); |
| | | }); |
| | | shopStoreDO.setDeleteStatus(2); |
| | | this.baseMapper.updateById(shopStoreDO); |
| | | //删除sys_user 物理删除 |
| | | this.baseMapper.deleteSysUserBySysUserId(shopStoreDO.getSysUserId()); |
| | | } |
| | | }else { |
| | | return R.fail("未查询到店铺"); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | @Override |
| | | public R getOneInfo(Long id) { |
| | | ComShopStoreDO comShopStoreDO = this.baseMapper.selectById(id); |
| | | if (comShopStoreDO == null) { |
| | | R.fail(500,"商铺不存在"); |
| | | return R.fail(500, "商铺不存在"); |
| | | } |
| | | ShopStoreVO shopStoreVO = new ShopStoreVO(); |
| | | BeanUtils.copyProperties(comShopStoreDO,shopStoreVO); |
| | | BeanUtils.copyProperties(comShopStoreDO, shopStoreVO); |
| | | return R.ok(shopStoreVO); |
| | | } |
| | | |
| | | @Override |
| | | public R getUserStoreInfo(Long userId) { |
| | | ComShopStoreDO comShopStoreDO = this.baseMapper.selectOne(new LambdaQueryWrapper<ComShopStoreDO>().eq(ComShopStoreDO::getDeleteStatus, 1).eq(ComShopStoreDO::getSysUserId, userId)); |
| | | if (comShopStoreDO == null) { |
| | | return R.fail(500, "商铺不存在"); |
| | | } |
| | | ShopStoreVO shopStoreVO = new ShopStoreVO(); |
| | | BeanUtils.copyProperties(comShopStoreDO, shopStoreVO); |
| | | return R.ok(shopStoreVO); |
| | | } |
| | | |
| | | @Override |
| | | public R getUserStoreInfo(String account) { |
| | | try { |
| | | R<LoginUserInfoVO> loginUserInfoVOR = userService.getUserInfo(account+"_5"); |
| | | LoginUserInfoVO loginUserInfoVO = JSONObject.parseObject(JSONObject.toJSONString(loginUserInfoVOR.getData()), LoginUserInfoVO.class); |
| | | |
| | | if(loginUserInfoVO==null){ |
| | | return R.fail(500, "该账号不存在"); |
| | | } |
| | | ComShopStoreDO comShopStoreDO = this.baseMapper.selectOne(new LambdaQueryWrapper<ComShopStoreDO>() |
| | | .eq(ComShopStoreDO::getDeleteStatus, 1).eq(ComShopStoreDO::getSysUserId, loginUserInfoVO.getUserId())); |
| | | if (comShopStoreDO == null) { |
| | | return R.fail(500, "该账号不存在"); |
| | | } |
| | | ShopStoreVO shopStoreVO = new ShopStoreVO(); |
| | | BeanUtils.copyProperties(comShopStoreDO, shopStoreVO); |
| | | return R.ok(shopStoreVO); |
| | | }catch (Exception e){ |
| | | return R.fail(); |
| | | } |
| | | } |
| | | } |
| | |
| | | package com.panzhihua.service_community.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.panzhihua.common.model.dtos.shop.ComShopAddressDTO; |
| | | import com.panzhihua.common.model.dtos.shop.PageComShopAddressDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.utlis.StringUtils; |
| | | import com.panzhihua.service_community.dao.ComShopUserAddressDAO; |
| | | import com.panzhihua.service_community.model.dos.ComShopUserAddressDO; |
| | | import com.panzhihua.service_community.service.ComShopUserAddressService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | /** |
| | | * @auther lyq |
| | |
| | | @Service |
| | | public class ComShopUserAddressServiceImpl extends ServiceImpl<ComShopUserAddressDAO, ComShopUserAddressDO> implements ComShopUserAddressService { |
| | | |
| | | /** |
| | | * 查询用户收获地址列表 |
| | | * @param comShopAddressDTO 请求参数 |
| | | * @return 用户收货地址列表 |
| | | */ |
| | | @Override |
| | | public R shopUserAddressList(PageComShopAddressDTO comShopAddressDTO){ |
| | | Page page = new Page<>(comShopAddressDTO.getPageNum(),comShopAddressDTO.getPageSize()); |
| | | return R.ok(this.baseMapper.pageUserAddressList(page,comShopAddressDTO.getUserId())); |
| | | } |
| | | |
| | | /** |
| | | * 用户添加收货地址 |
| | | * @param comShopAddressDTO 请求参数 |
| | | * @return 添加结果 |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R shopAddUserAddress(ComShopAddressDTO comShopAddressDTO){ |
| | | ComShopUserAddressDO userAddressDO = new ComShopUserAddressDO(); |
| | | BeanUtils.copyProperties(comShopAddressDTO,userAddressDO); |
| | | |
| | | //如果新增的地址为默认地址,需要修改原来的默认地址为不默认 |
| | | if(userAddressDO.getIsDefault().equals(ComShopUserAddressDO.isDefault.yes)){ |
| | | ComShopUserAddressDO oldUserAddressDO = this.baseMapper.selectOne(new QueryWrapper<ComShopUserAddressDO>() |
| | | .eq("user_id",comShopAddressDTO.getUserId()).eq("is_default",ComShopUserAddressDO.isDefault.yes)); |
| | | if(oldUserAddressDO != null){ |
| | | oldUserAddressDO.setIsDefault(ComShopUserAddressDO.isDefault.no); |
| | | this.baseMapper.updateById(oldUserAddressDO); |
| | | } |
| | | } |
| | | |
| | | if(this.baseMapper.insert(userAddressDO) > 0){ |
| | | return R.ok(); |
| | | }else{ |
| | | return R.fail("添加收货地址失败"); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 用户修改收货地址 |
| | | * @param comShopAddressDTO 请求参数 |
| | | * @return 修改结果 |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R shopEditUserAddress(ComShopAddressDTO comShopAddressDTO){ |
| | | |
| | | //查询用户收货地址 |
| | | ComShopUserAddressDO userAddressDO = this.baseMapper.selectById(comShopAddressDTO.getAddressId()); |
| | | if(userAddressDO == null){ |
| | | return R.fail("未查询到用户收货地址信息"); |
| | | } |
| | | |
| | | BeanUtils.copyProperties(comShopAddressDTO,userAddressDO); |
| | | //如果要修改的地址为默认地址,需要修改原来的默认地址为不默认 |
| | | if(comShopAddressDTO.getIsDefault().equals(ComShopUserAddressDO.isDefault.yes)){ |
| | | ComShopUserAddressDO oldUserAddressDO = this.baseMapper.selectOne(new QueryWrapper<ComShopUserAddressDO>() |
| | | .eq("user_id",comShopAddressDTO.getUserId()).eq("is_default",ComShopUserAddressDO.isDefault.yes)); |
| | | if(oldUserAddressDO != null){ |
| | | //判断当前要修改的默认地址是否本来就是默认地址 |
| | | if(!oldUserAddressDO.getId().equals(userAddressDO.getId())){ |
| | | oldUserAddressDO.setIsDefault(ComShopUserAddressDO.isDefault.no); |
| | | this.baseMapper.updateById(oldUserAddressDO); |
| | | } |
| | | } |
| | | } |
| | | |
| | | if(this.baseMapper.updateById(userAddressDO) > 0){ |
| | | return R.ok(); |
| | | }else{ |
| | | return R.fail("添加收货地址失败"); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 用户删除收货地址 |
| | | * @param addressId 收货地址id |
| | | * @return 删除结果 |
| | | */ |
| | | public R shopDelUserAddress(Long addressId){ |
| | | //查询用户收货地址 |
| | | ComShopUserAddressDO userAddressDO = this.baseMapper.selectById(addressId); |
| | | if(userAddressDO == null){ |
| | | return R.fail("未查询到用户收货地址信息"); |
| | | } |
| | | userAddressDO.setDeleteStatus(1); |
| | | if(this.baseMapper.updateById(userAddressDO) > 0){ |
| | | return R.ok(); |
| | | }else{ |
| | | return R.fail("删除收货地址失败"); |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | @Update("update com_pb_activity set status=3 where `status`=2 and TIMESTAMPDIFF(MINUTE,SYSDATE(),enroll_time_begin)<=0") |
| | | int updateStatusToSign(); |
| | | |
| | | @Update("update com_pb_activity set status=(if(TIMESTAMPDIFF(MINUTE,SYSDATE(),activity_time_end)<=0,5,4)) where `status` in (3,4) and TIMESTAMPDIFF(MINUTE,SYSDATE(),enroll_time_end)<=0") |
| | | @Update("update com_pb_activity set status=5 where `status` in (3,4) and TIMESTAMPDIFF(MINUTE,SYSDATE(),enroll_time_end)<=0") |
| | | int updateStatusToActiveOrEnd(); |
| | | @Select("select type,name from sys_user where user_id=#{createBy}") |
| | | LoginUserInfoVO selectUserInfoByUserId(Long createBy); |
| | |
| | | public R addactivity(PartyBuildingActivityVO partyBuildingActivityVO) { |
| | | ComPbActivityDO comPbActivityDO = new ComPbActivityDO(); |
| | | BeanUtils.copyProperties(partyBuildingActivityVO, comPbActivityDO); |
| | | comPbActivityDO.setCreateAt(new Date()); |
| | | Date now = new Date(); |
| | | comPbActivityDO.setEnrollTimeBegin(now); |
| | | comPbActivityDO.setCreateAt(now); |
| | | |
| | | //默认设置为“进行中” |
| | | comPbActivityDO.setStatus(4); |
| | | |
| | | int insert = comBpActivityDAO.insert(comPbActivityDO); |
| | | if (insert > 0) { |
| | | return R.ok(); |
| | |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.SystemmanagementConfigVO; |
| | | import com.panzhihua.common.model.vos.shop.ShopStoreVO; |
| | | import com.panzhihua.common.model.vos.user.*; |
| | | import com.panzhihua.service_user.service.SysUserInputService; |
| | | import com.panzhihua.service_user.service.UserService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | @PostMapping("putuserisvolunteer") |
| | | R putUserIsVolunteer(@RequestParam("phone")String phone,@RequestParam("type")int type){ |
| | | return userService.putUserIsVolunteer(phone,type); |
| | | } |
| | | |
| | | /** |
| | | * 修改用户志愿者状态 |
| | | * @param userId 志愿者ID |
| | | * @param type 1是志愿者 0 不是 |
| | | */ |
| | | @PostMapping("putuserisvolunteerbyid") |
| | | R putUserIsVolunteerById(@RequestParam("userId")Long userId,@RequestParam("type")int type){ |
| | | return userService.putUserIsVolunteerById(userId, type); |
| | | } |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | /** |
| | | * 通过账号和渠道查询用户信息 |
| | | * @param account |
| | | * @return |
| | | */ |
| | | @GetMapping("getUserByAccount") |
| | | public R getSysUserVOByAccount(@RequestParam(value = "account") String account,@RequestParam(value = "type") Integer type){ |
| | | return userService.getSysUserVOByAccount(account, type); |
| | | } |
| | | |
| | | /** |
| | | *分页查询人口管理 |
| | | * @param pageInputUserDTO 查询参数 |
| | | * @return 分页数据 |
| | |
| | | R specialUserExport(@RequestBody ExportSpecialUserDTO exportSpecialUserDTO) { |
| | | return sysUserInputService.specialUserExport(exportSpecialUserDTO); |
| | | } |
| | | |
| | | /** |
| | | * 创建SysUser用户信息以及权限 |
| | | * @param storeVO 请求参数 |
| | | * @return 创建结果 |
| | | */ |
| | | @PostMapping("addSysUser") |
| | | public R addSysUser(@RequestBody ShopStoreVO storeVO){ |
| | | return userService.addSysUser(storeVO); |
| | | } |
| | | |
| | | /** |
| | | * 修改SysUser用户信息 |
| | | * @param storeVO 请求参数 |
| | | * @return 修改结果 |
| | | */ |
| | | @PostMapping("editSysUser") |
| | | public R editSysUser(@RequestBody ShopStoreVO storeVO){ |
| | | return userService.editSysUser(storeVO); |
| | | } |
| | | |
| | | /** |
| | | * 修改用户小程序首页活动提示 |
| | | * @param userEditTipsDTO 请求参数 |
| | | * @return 修改结果 |
| | | */ |
| | | @PostMapping("editUserTips") |
| | | public R editUserTips(@RequestBody SysUserEditTipsDTO userEditTipsDTO) { |
| | | return userService.editUserTips(userEditTipsDTO); |
| | | } |
| | | |
| | | /** |
| | | * 获取用户电子档案 |
| | | * @param userId 家庭成员信息 |
| | | * @return 结果 |
| | | */ |
| | | @GetMapping("getUserArchives") |
| | | public R getUserArchives(@RequestParam("userId") Long userId){ |
| | | return userService.getUserArchives(userId); |
| | | } |
| | | |
| | | /** |
| | | * 编辑用户电子档案 |
| | | * @param userArchivesVO 编辑的信息 |
| | | * @return 编辑结果 |
| | | */ |
| | | @PostMapping("updateUserArchives") |
| | | public R updateUserArchives(@RequestBody UpdateUserArchivesVO userArchivesVO){ |
| | | return userService.updateUserArchives(userArchivesVO); |
| | | } |
| | | } |
| | |
| | | import com.panzhihua.service_user.model.dos.SysRoleDO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Select; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | public interface RoleDAO extends BaseMapper<SysRoleDO> { |
| | | @Select("select r.* from sys_user_role u join sys_role r on u.role_id=r.role_id where u.user_id=#{userId}") |
| | | List<SysRoleDO> selectByUserId(Long userId); |
| | | |
| | | @Select("select r.role_key role,m.component url from sys_role r join sys_role_menu rm on r.role_id=rm.role_id join sys_menu m on rm.menu_id=m.menu_id WHERE m.component is not null ") |
| | | List<MenuVO> selectAllMenuUrl(); |
| | | |
| | | @Select("select r.role_key from sys_user_role ur join sys_role r on ur.role_id = r.role_id where ur.user_id=#{username}") |
| | | List<String> selectRoles(String username); |
| | | |
| | | @Select("") |
| | | Long selectMaxRole(Long communityId); |
| | | |
| | | @Select("delete from sys_role where role_key =#{roleKey}") |
| | | void deleteByRoleKey(@RequestParam("roleKey") String roleKey); |
| | | } |
| | |
| | | import com.panzhihua.common.model.vos.user.AdministratorsUserVO; |
| | | import com.panzhihua.common.model.vos.user.SysUserNoticeVO; |
| | | import com.panzhihua.common.model.vos.user.SysUserVO; |
| | | import com.panzhihua.common.model.vos.user.UpdateUserArchivesVO; |
| | | import com.panzhihua.service_user.model.dos.SysUserDO; |
| | | import com.panzhihua.service_user.model.dtos.DataKanbanDTO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.apache.ibatis.annotations.Select; |
| | | import org.apache.ibatis.annotations.Update; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | |
| | | "from sys_user u\n" + |
| | | "left join com_act a on u.community_id=a.community_id\n" + |
| | | " where\n" + |
| | | "u.type=1\n" + |
| | | "u.type=1 and u.community_id is not null \n" + |
| | | "<if test='pageUserAppletsBackstageDTO.phone != null and pageUserAppletsBackstageDTO.phone.trim() != ""'>" + |
| | | "and u.phone=#{pageUserAppletsBackstageDTO.phone}\n" + |
| | | " </if> " + |
| | |
| | | "\t LEFT JOIN sys_role r ON ur.role_id = r.role_id \n" + |
| | | "WHERE ur.role_id IS NOT NULL AND u.phone = #{phone} ") |
| | | Integer selectCountSysUser(@Param("phone")String phone); |
| | | |
| | | @Select("update com_shop_store set sys_user_id = #{sysUserId} where phone = #{phone}") |
| | | void updateStoreByPhone(@Param("phone")String phone, @Param("sysUserId")Long sysUserId); |
| | | |
| | | @Select("delete from com_shop_store where delete_status = 1 and phone = #{phone}") |
| | | void deleteStoreByPhoneAndStatus(@RequestParam("phone") String phone); |
| | | |
| | | @Select("update sys_user set" + |
| | | " card_photo_front = #{userArchivesVO.cardPhotoFront} \n" + |
| | | ", card_photo_back = #{userArchivesVO.cardPhotoBack} \n" + |
| | | ",family_book = #{userArchivesVO.familyBook} \n" + |
| | | " where user_id = #{userArchivesVO.userId}") |
| | | void updateUserArchives(@Param("userArchivesVO") UpdateUserArchivesVO userArchivesVO); |
| | | |
| | | } |
| | |
| | | private String job; |
| | | |
| | | /** |
| | | * 证件照(人像面)照片 |
| | | */ |
| | | private String cardPhotoFront; |
| | | /** |
| | | * 证件照(国徽面)照片 |
| | | */ |
| | | private String cardPhotoBack; |
| | | /** |
| | | * 户口本照片 逗号隔开 |
| | | */ |
| | | private String familyBook; |
| | | |
| | | /** |
| | | * create_at |
| | | */ |
| | | @TableField(fill = FieldFill.INSERT) |
| | |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | |
| | | |
| | | /** |
| | | * 用户对象 sys_user |
| | | * |
| | | * |
| | | * @author HAUGNHONGFA |
| | | */ |
| | | @Data |
| | | @TableName("sys_user") |
| | | public class SysUserDO implements Serializable |
| | | { |
| | | public class SysUserDO implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * user_id |
| | | */ |
| | | @TableId(type=IdType.AUTO) |
| | | @TableId(type = IdType.AUTO) |
| | | private Long userId; |
| | | |
| | | /** |
| | |
| | | */ |
| | | private Integer continuousLandingDays; |
| | | |
| | | /** |
| | | * 小程序首页是否显示公告(1.是 2.否) |
| | | */ |
| | | private Integer isTips; |
| | | |
| | | |
| | | /** |
| | | * 证件照(人像面)照片 |
| | | */ |
| | | private String cardPhotoFront; |
| | | /** |
| | | * 证件照(国徽面)照片 |
| | | */ |
| | | private String cardPhotoBack; |
| | | |
| | | /** |
| | | * 户口本照片 逗号隔开 |
| | | */ |
| | | private String familyBook; |
| | | |
| | | } |
| | |
| | | import com.panzhihua.common.model.dtos.PageDTO; |
| | | import com.panzhihua.common.model.dtos.community.ExportUserDTO; |
| | | import com.panzhihua.common.model.dtos.community.NoticeReadDTO; |
| | | import com.panzhihua.common.model.dtos.user.EexcelUserDTO; |
| | | import com.panzhihua.common.model.dtos.user.PageFeedBackDTO; |
| | | import com.panzhihua.common.model.dtos.user.PageUserAppletsBackstageDTO; |
| | | import com.panzhihua.common.model.dtos.user.SysUserEditTipsDTO; |
| | | import com.panzhihua.common.model.dtos.user.SysUserFeedbackDTO; |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.SystemmanagementConfigVO; |
| | | import com.panzhihua.common.model.vos.shop.ShopStoreVO; |
| | | import com.panzhihua.common.model.vos.user.*; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @program: springcloud_k8s_panzhihuazhihuishequ |
| | |
| | | */ |
| | | R putUserIsVolunteer(String phone, int type); |
| | | /** |
| | | * 修改用户志愿者状态 |
| | | * @param userId 用户ID |
| | | * @param type 1是志愿者 0 不是 |
| | | */ |
| | | R putUserIsVolunteerById(Long userId, int type); |
| | | /** |
| | | * 用户绑定社区、小区 |
| | | * @param loginUserInfoVO 社区小区数据 |
| | | * @return 绑定结果 |
| | |
| | | */ |
| | | R putUser(LoginUserInfoVO loginUserInfoVO); |
| | | |
| | | /** |
| | | * 家庭成员列表 |
| | | * @param userId 登录用户 |
| | | * @return 成员集合 |
| | | */ |
| | | R listFamily(Long userId); |
| | | /** |
| | | * 新增家庭成员 |
| | | * @param comMngFamilyInfoVO 家庭成员基本信息 |
| | | * @return 增加结果 |
| | | */ |
| | | R addFamily(ComMngFamilyInfoVO comMngFamilyInfoVO); |
| | | /** |
| | | * 编辑家庭成员 |
| | | * @param comMngFamilyInfoVO 家庭成员信息 |
| | | * @return 编辑结果 |
| | | */ |
| | | R putFamily(ComMngFamilyInfoVO comMngFamilyInfoVO); |
| | | /** |
| | | * 新增运营、社区后台账户 |
| | | * @param administratorsUserVO 账户信息 |
| | |
| | | * @return 标签集合 |
| | | */ |
| | | R listTags(Long communityId); |
| | | |
| | | /** |
| | | * 通过账号查询用户信息 |
| | | * @param account |
| | | * @param type |
| | | * @return |
| | | */ |
| | | |
| | | R getSysUserVOByAccount(String account, Integer type); |
| | | |
| | | /** |
| | | * 新增SysUser |
| | | * @param storeVO 请求参数 |
| | | * @return 新增结果 |
| | | */ |
| | | R addSysUser(ShopStoreVO storeVO); |
| | | |
| | | /** |
| | | * 修改SysUser用户信息 |
| | | * @param storeVO 请求参数 |
| | | * @return 修改结果 |
| | | */ |
| | | R editSysUser(ShopStoreVO storeVO); |
| | | |
| | | /** |
| | | * 修改用户小程序首页活动提示 |
| | | * @param userEditTipsDTO 请求参数 |
| | | * @return 修改结果 |
| | | */ |
| | | R editUserTips(SysUserEditTipsDTO userEditTipsDTO); |
| | | |
| | | /** |
| | | * 家庭成员列表 |
| | | * @param userId 登录用户 |
| | | * @return 成员集合 |
| | | */ |
| | | R listFamily(Long userId); |
| | | /** |
| | | * 新增家庭成员 |
| | | * @param comMngFamilyInfoVO 家庭成员基本信息 |
| | | * @return 增加结果 |
| | | */ |
| | | R addFamily(ComMngFamilyInfoVO comMngFamilyInfoVO); |
| | | /** |
| | | * 编辑家庭成员 |
| | | * @param comMngFamilyInfoVO 家庭成员信息 |
| | | * @return 编辑结果 |
| | | */ |
| | | R putFamily(ComMngFamilyInfoVO comMngFamilyInfoVO); |
| | | |
| | | /** |
| | | * 当前登陆用户的电子档案 |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | R getUserArchives(Long userId); |
| | | |
| | | /** |
| | | * 编辑电子档案 |
| | | * @param userArchivesVO |
| | | * @return |
| | | */ |
| | | R updateUserArchives(UpdateUserArchivesVO userArchivesVO); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.panzhihua.common.constants.Constants; |
| | | import com.panzhihua.common.constants.UserConstants; |
| | | import com.panzhihua.common.exceptions.ServiceException; |
| | | import com.panzhihua.common.model.dtos.PageDTO; |
| | | import com.panzhihua.common.model.dtos.community.ExportUserDTO; |
| | | import com.panzhihua.common.model.dtos.community.NoticeReadDTO; |
| | | import com.panzhihua.common.model.dtos.user.EexcelUserDTO; |
| | | import com.panzhihua.common.model.dtos.user.PageFeedBackDTO; |
| | | import com.panzhihua.common.model.dtos.user.PageUserAppletsBackstageDTO; |
| | | import com.panzhihua.common.model.dtos.user.SysUserFeedbackDTO; |
| | | import com.panzhihua.common.model.dtos.user.*; |
| | | import com.panzhihua.common.model.vos.*; |
| | | import com.panzhihua.common.model.vos.community.ComActVO; |
| | | import com.panzhihua.common.model.vos.community.ComMngVolunteerMngVO; |
| | | import com.panzhihua.common.model.vos.partybuilding.ActivityManagerVO; |
| | | import com.panzhihua.common.model.vos.shop.ShopStoreVO; |
| | | import com.panzhihua.common.model.vos.user.*; |
| | | import com.panzhihua.common.utlis.IdCard; |
| | | import com.panzhihua.common.utlis.RealNameUtil; |
| | |
| | | return R.fail(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 修改用户志愿者状态 |
| | | * |
| | | * @param userId 志愿者用户ID |
| | | * @param type |
| | | */ |
| | | @Override |
| | | public R putUserIsVolunteerById(Long userId, int type) { |
| | | SysUserDO sysUserDO = new SysUserDO(); |
| | | sysUserDO.setIsVolunteer(type); |
| | | sysUserDO.setUserId(userId); |
| | | |
| | | SysUserDO userInDB = userDao.selectById(userId); |
| | | if (userInDB != null) { |
| | | boolean isVol = userInDB.getIsVolunteer() == 1; |
| | | if (isVol) { |
| | | return R.fail("用户已是志愿者"); |
| | | } |
| | | if (userInDB.getType() != 1) { |
| | | return R.fail("用户不是小程序用户"); |
| | | } |
| | | int update = userDao.updateById(sysUserDO); |
| | | if (update > 0) { |
| | | return R.ok(); |
| | | } |
| | | } |
| | | return R.fail(); |
| | | } |
| | | |
| | | /** |
| | | * 用户绑定社区、小区 |
| | | * |
| | |
| | | //接入第三方实名认证 |
| | | String idCard = loginUserInfoVO.getIdCard(); |
| | | String name = loginUserInfoVO.getName(); |
| | | log.info("用户实名认证发送请求,姓名:" + name + "身份证号码:" + idCard); |
| | | boolean b = RealNameUtil.authentication(idCard, name); |
| | | if (!b) { |
| | | return R.fail("身份认证失败:公安系统认证错误"); |
| | |
| | | if (!ObjectUtils.isEmpty(comMngFamilyInfoDO1)) { |
| | | return R.fail("家庭成员已经存在"); |
| | | } |
| | | comMngFamilyInfoDO.setAge(IdCard.IdNOToAge(comMngFamilyInfoVO.getIdCard())); |
| | | int insert = comMngFamilyInfoDAO.insert(comMngFamilyInfoDO); |
| | | if (insert > 0) { |
| | | return R.ok(); |
| | |
| | | public R putFamily(ComMngFamilyInfoVO comMngFamilyInfoVO) { |
| | | ComMngFamilyInfoDO comMngFamilyInfoDO = new ComMngFamilyInfoDO(); |
| | | BeanUtils.copyProperties(comMngFamilyInfoVO, comMngFamilyInfoDO); |
| | | comMngFamilyInfoDO.setAge(IdCard.IdNOToAge(comMngFamilyInfoVO.getIdCard())); |
| | | int update = comMngFamilyInfoDAO.updateById(comMngFamilyInfoDO); |
| | | if (update > 0) { |
| | | return R.ok(); |
| | |
| | | Long communityId = administratorsUserVO.getCommunityId(); |
| | | //新增社区高级管理员角色 |
| | | SysRoleDO sysRoleDO = new SysRoleDO(); |
| | | if(roleId.intValue() == 999999999){ |
| | | if (roleId.intValue() == 999999999) { |
| | | sysRoleDO.setCommunityId(communityId); |
| | | sysRoleDO.setRoleName("超级管理员"); |
| | | sysRoleDO.setRoleKey("chaojiguanliyuan" + communityId); |
| | | }else{ |
| | | sysRoleDO.setRoleKey(Constants.ADMIN_SHOP_ROLE_KEY + communityId); |
| | | } else { |
| | | sysRoleDO.setCommunityId(0L); |
| | | sysRoleDO.setRoleName(administratorsUserVO.getShopStoreName()); |
| | | sysRoleDO.setRoleKey("shanghupingtai" + administratorsUserVO.getShopStorePhone()); |
| | | sysRoleDO.setRoleKey(Constants.SHOP_ROLE_KEY + administratorsUserVO.getShopStorePhone()); |
| | | } |
| | | sysRoleDO.setRoleSort(0); |
| | | sysRoleDO.setCreateBy(administratorsUserVO.getUserId()); |
| | |
| | | communityUserInfoVO.setIdCard(idCard); |
| | | } |
| | | communityUserInfoVO.setCreateAt(sysUserDO.getCreateAt()); |
| | | communityUserInfoVO.setCardPhotoBack(sysUserDO.getCardPhotoBack()); |
| | | communityUserInfoVO.setCardPhotoFront(sysUserDO.getCardPhotoFront()); |
| | | communityUserInfoVO.setFamilyBook(sysUserDO.getFamilyBook()); |
| | | communityUserInfoVO.setName(sysUserDO.getName()); |
| | | String phone = sysUserDO.getPhone(); |
| | | communityUserInfoVO.setPhone(phone); |
| | |
| | | } |
| | | return R.ok(list); |
| | | } |
| | | |
| | | @Override |
| | | public R getSysUserVOByAccount(String account, Integer type) { |
| | | LambdaQueryWrapper<SysUserDO> query = new QueryWrapper<SysUserDO>().lambda().eq(SysUserDO::getAccount, account); |
| | | query.eq(SysUserDO::getType, type); |
| | | SysUserDO sysUserDO = userDao.selectOne(query); |
| | | if (ObjectUtils.isEmpty(sysUserDO)) { |
| | | return R.fail("用户不存在"); |
| | | } |
| | | SysUserVO sysUserVO = new SysUserVO(); |
| | | BeanUtils.copyProperties(sysUserDO, sysUserVO); |
| | | return R.ok(sysUserVO); |
| | | } |
| | | |
| | | /** |
| | | * 新增SysUser |
| | | * |
| | | * @param storeVO 请求参数 |
| | | * @return 新增结果 |
| | | */ |
| | | @Override |
| | | public R addSysUser(ShopStoreVO storeVO) { |
| | | |
| | | SysUserDO sysUserDO = new SysUserDO(); |
| | | Long communityId = 0L; |
| | | //新增社区高级管理员角色 |
| | | SysRoleDO sysRoleDO = new SysRoleDO(); |
| | | sysRoleDO.setCommunityId(0L); |
| | | sysRoleDO.setRoleName(storeVO.getName()); |
| | | sysRoleDO.setRoleKey(Constants.SHOP_ROLE_KEY + storeVO.getStoreAccount()); |
| | | sysRoleDO.setRoleSort(0); |
| | | sysRoleDO.setCreateBy(storeVO.getLoginUserId()); |
| | | int insert = roleDAO.insert(sysRoleDO); |
| | | if (insert < 0) { |
| | | return R.fail(); |
| | | } |
| | | //新角色设置所有权限 |
| | | MenuRoleVO menuRoleVO = new MenuRoleVO(); |
| | | menuRoleVO.setIsAll(1); |
| | | menuRoleVO.setCommunityId(communityId); |
| | | menuRoleVO.setRoleId(sysRoleDO.getRoleId()); |
| | | this.putMenuRole(menuRoleVO); |
| | | |
| | | //sys_user 表 |
| | | String encode = new BCryptPasswordEncoder().encode(storeVO.getStorePassword()); |
| | | BeanUtils.copyProperties(storeVO, sysUserDO); |
| | | sysUserDO.setAccount(storeVO.getStoreAccount()); |
| | | sysUserDO.setType(5); |
| | | sysUserDO.setAreaId(null); |
| | | sysUserDO.setStatus(1); |
| | | sysUserDO.setPhone(storeVO.getPhone()); |
| | | sysUserDO.setName(storeVO.getContacts()); |
| | | sysUserDO.setPassword(encode); |
| | | try { |
| | | insert = userDao.insert(sysUserDO); |
| | | //把SysUserId赋值给店铺 |
| | | if (sysUserDO.getUserId() != null) { |
| | | userDao.updateStoreByPhone(storeVO.getPhone(), sysUserDO.getUserId()); |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | log.error("新增后台用户报错【{}】", e.getMessage()); |
| | | if (e.getMessage().contains("union_phone_type")) { |
| | | userDao.deleteStoreByPhoneAndStatus(storeVO.getPhone()); |
| | | roleDAO.deleteByRoleKey(Constants.SHOP_ROLE_KEY + storeVO.getStoreAccount()); |
| | | return R.fail("手机号已经存在"); |
| | | } else if (e.getMessage().contains("union_account_type")) { |
| | | return R.fail("账户已经存在"); |
| | | } |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 修改SysUser用户信息 |
| | | * |
| | | * @param storeVO 请求参数 |
| | | * @return 修改结果 |
| | | */ |
| | | @Override |
| | | public R editSysUser(ShopStoreVO storeVO) { |
| | | SysUserDO sysUserDO1 = userDao.selectOne(new QueryWrapper<SysUserDO>().lambda().eq(SysUserDO::getPhone, storeVO.getPhone()) |
| | | .eq(SysUserDO::getType, 5)); |
| | | if (sysUserDO1 == null) { |
| | | return R.fail("未查询到后台管理用户!"); |
| | | } |
| | | String encode = new BCryptPasswordEncoder().encode(storeVO.getStorePassword()); |
| | | sysUserDO1.setPassword(encode); |
| | | if (userDao.updateById(sysUserDO1) > 0) { |
| | | return R.ok(); |
| | | } |
| | | return R.fail("密码修改失败"); |
| | | } |
| | | |
| | | /** |
| | | * 修改用户小程序首页活动提示 |
| | | * |
| | | * @param userEditTipsDTO 请求参数 |
| | | * @return 修改结果 |
| | | */ |
| | | public R editUserTips(SysUserEditTipsDTO userEditTipsDTO) { |
| | | //查询用户信息 |
| | | SysUserDO userDO = userDao.selectById(userEditTipsDTO.getUserId()); |
| | | if (userDO == null) { |
| | | return R.fail("未查询到用户信息"); |
| | | } |
| | | //修改用户信息 |
| | | userDO.setIsTips(userEditTipsDTO.getIsTips()); |
| | | userDao.updateById(userDO); |
| | | if (userDao.updateById(userDO) > 0) { |
| | | return R.ok(); |
| | | } else { |
| | | return R.fail(); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public R getUserArchives(Long userId) { |
| | | //查询用户信息 |
| | | SysUserDO userDO = userDao.selectById(userId); |
| | | if (userDO == null) { |
| | | return R.fail("未查询到用户信息"); |
| | | } |
| | | UserArchivesVO userArchivesVO = new UserArchivesVO(); |
| | | BeanUtils.copyProperties(userDO, userArchivesVO); |
| | | userArchivesVO.setUserId(userDO.getUserId()); |
| | | return R.ok(userArchivesVO); |
| | | } |
| | | |
| | | @Override |
| | | public R updateUserArchives(UpdateUserArchivesVO userArchivesVO) { |
| | | if(userArchivesVO.getUserId()==null){ |
| | | return R.fail("未查询到用户信息"); |
| | | } |
| | | userDao.updateUserArchives(userArchivesVO); |
| | | return R.ok(); |
| | | } |
| | | } |
New file |
| | |
| | | HELP.md |
| | | target/ |
| | | !.mvn/wrapper/maven-wrapper.jar |
| | | !**/src/main/**/target/ |
| | | !**/src/test/**/target/ |
| | | |
| | | ### STS ### |
| | | .apt_generated |
| | | .classpath |
| | | .factorypath |
| | | .project |
| | | .settings |
| | | .springBeans |
| | | .sts4-cache |
| | | |
| | | ### IntelliJ IDEA ### |
| | | .idea |
| | | *.iws |
| | | *.iml |
| | | *.ipr |
| | | |
| | | ### NetBeans ### |
| | | /nbproject/private/ |
| | | /nbbuild/ |
| | | /dist/ |
| | | /nbdist/ |
| | | /.nb-gradle/ |
| | | build/ |
| | | !**/src/main/**/build/ |
| | | !**/src/test/**/build/ |
| | | |
| | | ### VS Code ### |
| | | .vscode/ |
New file |
| | |
| | | @REM ---------------------------------------------------------------------------- |
| | | @REM Licensed to the Apache Software Foundation (ASF) under one |
| | | @REM or more contributor license agreements. See the NOTICE file |
| | | @REM distributed with this work for additional information |
| | | @REM regarding copyright ownership. The ASF licenses this file |
| | | @REM to you under the Apache License, Version 2.0 (the |
| | | @REM "License"); you may not use this file except in compliance |
| | | @REM with the License. You may obtain a copy of the License at |
| | | @REM |
| | | @REM https://www.apache.org/licenses/LICENSE-2.0 |
| | | @REM |
| | | @REM Unless required by applicable law or agreed to in writing, |
| | | @REM software distributed under the License is distributed on an |
| | | @REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| | | @REM KIND, either express or implied. See the License for the |
| | | @REM specific language governing permissions and limitations |
| | | @REM under the License. |
| | | @REM ---------------------------------------------------------------------------- |
| | | |
| | | @REM ---------------------------------------------------------------------------- |
| | | @REM Maven Start Up Batch script |
| | | @REM |
| | | @REM Required ENV vars: |
| | | @REM JAVA_HOME - location of a JDK home dir |
| | | @REM |
| | | @REM Optional ENV vars |
| | | @REM M2_HOME - location of maven2's installed home dir |
| | | @REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands |
| | | @REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending |
| | | @REM MAVEN_OPTS - parameters passed to the Java VM when running Maven |
| | | @REM e.g. to debug Maven itself, use |
| | | @REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 |
| | | @REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files |
| | | @REM ---------------------------------------------------------------------------- |
| | | |
| | | @REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' |
| | | @echo off |
| | | @REM set title of command window |
| | | title %0 |
| | | @REM enable echoing by setting MAVEN_BATCH_ECHO to 'on' |
| | | @if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% |
| | | |
| | | @REM set %HOME% to equivalent of $HOME |
| | | if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") |
| | | |
| | | @REM Execute a user defined script before this one |
| | | if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre |
| | | @REM check for pre script, once with legacy .bat ending and once with .cmd ending |
| | | if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat" |
| | | if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd" |
| | | :skipRcPre |
| | | |
| | | @setlocal |
| | | |
| | | set ERROR_CODE=0 |
| | | |
| | | @REM To isolate internal variables from possible post scripts, we use another setlocal |
| | | @setlocal |
| | | |
| | | @REM ==== START VALIDATION ==== |
| | | if not "%JAVA_HOME%" == "" goto OkJHome |
| | | |
| | | echo. |
| | | echo Error: JAVA_HOME not found in your environment. >&2 |
| | | echo Please set the JAVA_HOME variable in your environment to match the >&2 |
| | | echo location of your Java installation. >&2 |
| | | echo. |
| | | goto error |
| | | |
| | | :OkJHome |
| | | if exist "%JAVA_HOME%\bin\java.exe" goto init |
| | | |
| | | echo. |
| | | echo Error: JAVA_HOME is set to an invalid directory. >&2 |
| | | echo JAVA_HOME = "%JAVA_HOME%" >&2 |
| | | echo Please set the JAVA_HOME variable in your environment to match the >&2 |
| | | echo location of your Java installation. >&2 |
| | | echo. |
| | | goto error |
| | | |
| | | @REM ==== END VALIDATION ==== |
| | | |
| | | :init |
| | | |
| | | @REM Find the project base dir, i.e. the directory that contains the folder ".mvn". |
| | | @REM Fallback to current working directory if not found. |
| | | |
| | | set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR% |
| | | IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir |
| | | |
| | | set EXEC_DIR=%CD% |
| | | set WDIR=%EXEC_DIR% |
| | | :findBaseDir |
| | | IF EXIST "%WDIR%"\.mvn goto baseDirFound |
| | | cd .. |
| | | IF "%WDIR%"=="%CD%" goto baseDirNotFound |
| | | set WDIR=%CD% |
| | | goto findBaseDir |
| | | |
| | | :baseDirFound |
| | | set MAVEN_PROJECTBASEDIR=%WDIR% |
| | | cd "%EXEC_DIR%" |
| | | goto endDetectBaseDir |
| | | |
| | | :baseDirNotFound |
| | | set MAVEN_PROJECTBASEDIR=%EXEC_DIR% |
| | | cd "%EXEC_DIR%" |
| | | |
| | | :endDetectBaseDir |
| | | |
| | | IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig |
| | | |
| | | @setlocal EnableExtensions EnableDelayedExpansion |
| | | for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a |
| | | @endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS% |
| | | |
| | | :endReadAdditionalConfig |
| | | |
| | | SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" |
| | | set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar" |
| | | set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain |
| | | |
| | | set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" |
| | | |
| | | FOR /F "tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO ( |
| | | IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B |
| | | ) |
| | | |
| | | @REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central |
| | | @REM This allows using the maven wrapper in projects that prohibit checking in binary data. |
| | | if exist %WRAPPER_JAR% ( |
| | | if "%MVNW_VERBOSE%" == "true" ( |
| | | echo Found %WRAPPER_JAR% |
| | | ) |
| | | ) else ( |
| | | if not "%MVNW_REPOURL%" == "" ( |
| | | SET DOWNLOAD_URL="%MVNW_REPOURL%/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" |
| | | ) |
| | | if "%MVNW_VERBOSE%" == "true" ( |
| | | echo Couldn't find %WRAPPER_JAR%, downloading it ... |
| | | echo Downloading from: %DOWNLOAD_URL% |
| | | ) |
| | | |
| | | powershell -Command "&{"^ |
| | | "$webclient = new-object System.Net.WebClient;"^ |
| | | "if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^ |
| | | "$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^ |
| | | "}"^ |
| | | "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^ |
| | | "}" |
| | | if "%MVNW_VERBOSE%" == "true" ( |
| | | echo Finished downloading %WRAPPER_JAR% |
| | | ) |
| | | ) |
| | | @REM End of extension |
| | | |
| | | @REM Provide a "standardized" way to retrieve the CLI args that will |
| | | @REM work with both Windows and non-Windows executions. |
| | | set MAVEN_CMD_LINE_ARGS=%* |
| | | |
| | | %MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* |
| | | if ERRORLEVEL 1 goto error |
| | | goto end |
| | | |
| | | :error |
| | | set ERROR_CODE=1 |
| | | |
| | | :end |
| | | @endlocal & set ERROR_CODE=%ERROR_CODE% |
| | | |
| | | if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost |
| | | @REM check for post script, once with legacy .bat ending and once with .cmd ending |
| | | if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat" |
| | | if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd" |
| | | :skipRcPost |
| | | |
| | | @REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' |
| | | if "%MAVEN_BATCH_PAUSE%" == "on" pause |
| | | |
| | | if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE% |
| | | |
| | | exit /B %ERROR_CODE% |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| | | xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> |
| | | <modelVersion>4.0.0</modelVersion> |
| | | <parent> |
| | | <groupId>com.panzhihua</groupId> |
| | | <artifactId>zhihuishequ</artifactId> |
| | | <version>1.0-SNAPSHOT</version> |
| | | </parent> |
| | | <groupId>com.panzhihua</groupId> |
| | | <artifactId>shop_backstage</artifactId> |
| | | <version>0.0.1-SNAPSHOT</version> |
| | | <name>shop_backstage</name> |
| | | <description>商家后台</description> |
| | | |
| | | <dependencies> |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-web</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.springframework.cloud</groupId> |
| | | <artifactId>spring-cloud-starter-config</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.springframework.cloud</groupId> |
| | | <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.springframework.cloud</groupId> |
| | | <artifactId>spring-cloud-starter-openfeign</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.projectlombok</groupId> |
| | | <artifactId>lombok</artifactId> |
| | | <optional>true</optional> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.panzhihua</groupId> |
| | | <artifactId>common</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.netflix.hystrix</groupId> |
| | | <artifactId>hystrix-javanica</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.github.xiaoymin</groupId> |
| | | <artifactId>swagger-bootstrap-ui</artifactId> |
| | | </dependency> |
| | | </dependencies> |
| | | |
| | | <build> |
| | | <plugins> |
| | | <plugin> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-maven-plugin</artifactId> |
| | | <configuration> |
| | | <mainClass>com.panzhihua.shop_backstage.ShopBackstageApplication</mainClass> |
| | | </configuration> |
| | | <executions> |
| | | <execution> |
| | | <goals> |
| | | <goal>repackage</goal> |
| | | </goals> |
| | | </execution> |
| | | </executions> |
| | | </plugin> |
| | | |
| | | <plugin> |
| | | <groupId>com.spotify</groupId> |
| | | <artifactId>docker-maven-plugin</artifactId> |
| | | <version>1.2.0</version> |
| | | <configuration> |
| | | <imageName>registry.cn-chengdu.aliyuncs.com/panzhihua/shop_backstage:v1</imageName> |
| | | <serverId></serverId> |
| | | <baseImage>java</baseImage> |
| | | <entryPoint>["java", "-jar", "/${project.build.finalName}.jar"]</entryPoint> |
| | | <resources> |
| | | <resource> |
| | | <targetPath>/</targetPath> |
| | | <directory>${project.build.directory}</directory> |
| | | <include>${project.build.finalName}.jar</include> |
| | | </resource> |
| | | </resources> |
| | | </configuration> |
| | | </plugin> |
| | | </plugins> |
| | | </build> |
| | | |
| | | <repositories> |
| | | <repository> |
| | | <id>spring-snapshots</id> |
| | | <name>Spring Snapshots</name> |
| | | <url>https://repo.spring.io/snapshot</url> |
| | | <snapshots> |
| | | <enabled>true</enabled> |
| | | </snapshots> |
| | | </repository> |
| | | <repository> |
| | | <id>spring-milestones</id> |
| | | <name>Spring Milestones</name> |
| | | <url>https://repo.spring.io/milestone</url> |
| | | </repository> |
| | | </repositories> |
| | | |
| | | </project> |
New file |
| | |
| | | package com.panzhihua.shop_backstage; |
| | | |
| | | import org.springframework.boot.SpringApplication; |
| | | import org.springframework.cloud.client.SpringCloudApplication; |
| | | import org.springframework.cloud.client.circuitbreaker.EnableCircuitBreaker; |
| | | import org.springframework.cloud.netflix.eureka.EnableEurekaClient; |
| | | import org.springframework.cloud.openfeign.EnableFeignClients; |
| | | import org.springframework.context.annotation.ComponentScan; |
| | | import springfox.documentation.swagger2.annotations.EnableSwagger2; |
| | | |
| | | @EnableSwagger2 |
| | | @SpringCloudApplication |
| | | @EnableCircuitBreaker |
| | | @EnableEurekaClient |
| | | @EnableFeignClients(basePackages = {"com.panzhihua.common.service"}) |
| | | @ComponentScan({"com.panzhihua.shop_backstage","com.panzhihua.common"}) |
| | | public class ShopBackstageApplication { |
| | | |
| | | public static void main(String[] args) { |
| | | SpringApplication.run(ShopBackstageApplication.class, args); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.shop_backstage.aop; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.panzhihua.common.constants.Constants; |
| | | import com.panzhihua.common.constants.TokenConstant; |
| | | import com.panzhihua.common.interfaces.ShopOperLog; |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.shop.ShopOperLogVO; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | import com.panzhihua.common.service.user.UserService; |
| | | import com.panzhihua.common.utlis.AES; |
| | | import com.panzhihua.common.utlis.IPUtil; |
| | | import com.panzhihua.shop_backstage.model.vos.LoginBody; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.aspectj.lang.JoinPoint; |
| | | import org.aspectj.lang.annotation.AfterReturning; |
| | | import org.aspectj.lang.annotation.Aspect; |
| | | import org.aspectj.lang.annotation.Pointcut; |
| | | import org.aspectj.lang.reflect.MethodSignature; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.util.ObjectUtils; |
| | | import org.springframework.web.context.request.RequestAttributes; |
| | | import org.springframework.web.context.request.RequestContextHolder; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.BufferedReader; |
| | | import java.io.IOException; |
| | | import java.lang.reflect.Method; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @ClasssName 商家后台日志 |
| | | * @Description |
| | | * @Author cedoo |
| | | * @Date 2021/4/16 |
| | | * @Version 1.0 |
| | | **/ |
| | | @Slf4j |
| | | @Aspect |
| | | @Component |
| | | public class OperLogAspect { |
| | | |
| | | @Resource |
| | | private CommunityService communityService; |
| | | @Resource |
| | | private UserService userService; |
| | | |
| | | /** |
| | | * 设置操作日志切入点 记录操作日志 在注解的位置切入代码 |
| | | */ |
| | | @Pointcut("@annotation(com.panzhihua.common.interfaces.ShopOperLog)") |
| | | public void operLogPoinCut() { |
| | | } |
| | | |
| | | |
| | | |
| | | // /** |
| | | // * 设置操作异常切入点记录异常日志 扫描所有controller包下操作 |
| | | // */ |
| | | // @Pointcut("execution(* com.hyd.zcar.cms.controller..*.*(..))") |
| | | // public void operExceptionLogPoinCut() { |
| | | // } |
| | | |
| | | /** |
| | | * 正常返回通知,拦截用户操作日志,连接点正常执行完成后执行, 如果连接点抛出异常,则不会执行 |
| | | * |
| | | * @param joinPoint 切入点 |
| | | * @param keys 返回结果 |
| | | */ |
| | | @AfterReturning(value = "operLogPoinCut()", returning = "keys") |
| | | public void saveOperLog(JoinPoint joinPoint, Object keys) { |
| | | log.info("进入切面"); |
| | | // 获取RequestAttributes |
| | | RequestAttributes requestAttributes = RequestContextHolder.getRequestAttributes(); |
| | | // 从获取RequestAttributes中获取HttpServletRequest的信息 |
| | | HttpServletRequest request = (HttpServletRequest) requestAttributes |
| | | .resolveReference(RequestAttributes.REFERENCE_REQUEST); |
| | | // 登录对象信息 |
| | | String userInfo = request.getHeader(TokenConstant.TOKEN_USERINFO); |
| | | boolean empty = ObjectUtils.isEmpty(userInfo); |
| | | if (empty) { |
| | | log.error("操作日志获取登录用户信息失败【{}】",joinPoint); |
| | | return; |
| | | } |
| | | byte[] bytes = AES.parseHexStr2Byte(userInfo); |
| | | byte[] decrypt = AES.decrypt(bytes, Constants.AES_KEY); |
| | | userInfo=new String(decrypt); |
| | | LoginUserInfoVO loginUserInfoVO= JSONObject.parseObject(userInfo,LoginUserInfoVO.class); |
| | | |
| | | ShopOperLogVO shopOperlog = new ShopOperLogVO(); |
| | | try { |
| | | |
| | | // 从切面织入点处通过反射机制获取织入点处的方法 |
| | | MethodSignature signature = (MethodSignature) joinPoint.getSignature(); |
| | | // 获取切入点所在的方法 |
| | | Method method = signature.getMethod(); |
| | | // 获取操作 |
| | | ShopOperLog opLog = method.getAnnotation(ShopOperLog.class); |
| | | if (opLog != null) { |
| | | String operModul = opLog.operModul(); |
| | | int operType = opLog.operType(); |
| | | shopOperlog.setTitle(operModul); // 操作模块 |
| | | shopOperlog.setBusinessType(operType); // 操作类型 |
| | | } |
| | | // 获取请求的类名 |
| | | String className = joinPoint.getTarget().getClass().getName(); |
| | | // 获取请求的方法名 |
| | | String methodName = method.getName(); |
| | | methodName = className + "." + methodName; |
| | | |
| | | shopOperlog.setMethod(methodName); // 请求方法 |
| | | |
| | | if (joinPoint.getArgs().length > 0) { |
| | | for (Object o : joinPoint.getArgs()) { |
| | | if (o instanceof HttpServletRequest || o instanceof HttpServletResponse) { |
| | | continue; |
| | | } |
| | | shopOperlog.setOperParam(JSONObject.toJSONString(o)); // 请求参数 |
| | | } |
| | | } |
| | | |
| | | shopOperlog.setJsonResult(JSONObject.toJSONString(keys)); // 返回结果 |
| | | shopOperlog.setAccount(loginUserInfoVO.getAccount()); |
| | | shopOperlog.setOperName(loginUserInfoVO.getName()); // 请求用户名称 |
| | | shopOperlog.setOperIp(IPUtil.getIpAddress(request)); // 请求IP |
| | | shopOperlog.setOperUrl(request.getRequestURI()); // 请求URI |
| | | shopOperlog.setRequestMethod(request.getMethod()); |
| | | shopOperlog.setOperLocation(IPUtil.getIpBelongAddress(request)); |
| | | shopOperlog.setOperTime(new Date()); // 创建时间 |
| | | shopOperlog.setAccount(loginUserInfoVO.getAccount()); |
| | | Long communityId = loginUserInfoVO.getCommunityId(); |
| | | shopOperlog.setCommunityId(null==communityId?0:communityId); |
| | | shopOperlog.setUserId(loginUserInfoVO.getUserId()); |
| | | communityService.addShopOperLog(shopOperlog); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | // /** |
| | | // * 异常返回通知,用于拦截异常日志信息 连接点抛出异常后执行 |
| | | // * |
| | | // * @param joinPoint 切入点 |
| | | // * @param e 异常信息 |
| | | // */ |
| | | // @AfterThrowing(pointcut = "operExceptionLogPoinCut()", throwing = "e") |
| | | // public void saveExceptionLog(JoinPoint joinPoint, Throwable e) { |
| | | // // 获取RequestAttributes |
| | | // RequestAttributes requestAttributes = RequestContextHolder.getRequestAttributes(); |
| | | // // 从获取RequestAttributes中获取HttpServletRequest的信息 |
| | | // HttpServletRequest request = (HttpServletRequest) requestAttributes |
| | | // .resolveReference(RequestAttributes.REFERENCE_REQUEST); |
| | | // |
| | | // ExceptionLog excepLog = new ExceptionLog(); |
| | | // try { |
| | | // // 从切面织入点处通过反射机制获取织入点处的方法 |
| | | // MethodSignature signature = (MethodSignature) joinPoint.getSignature(); |
| | | // // 获取切入点所在的方法 |
| | | // Method method = signature.getMethod(); |
| | | // excepLog.setExcId(UuidUtil.get32UUID()); |
| | | // // 获取请求的类名 |
| | | // String className = joinPoint.getTarget().getClass().getName(); |
| | | // // 获取请求的方法名 |
| | | // String methodName = method.getName(); |
| | | // methodName = className + "." + methodName; |
| | | // // 请求的参数 |
| | | // Map<String, String> rtnMap = converMap(request.getParameterMap()); |
| | | // // 将参数所在的数组转换成json |
| | | // String params = JSON.toJSONString(rtnMap); |
| | | // excepLog.setExcRequParam(params); // 请求参数 |
| | | // excepLog.setOperMethod(methodName); // 请求方法名 |
| | | // excepLog.setExcName(e.getClass().getName()); // 异常名称 |
| | | // excepLog.setExcMessage(stackTraceToString(e.getClass().getName(), e.getMessage(), e.getStackTrace())); // 异常信息 |
| | | // excepLog.setOperUserId(UserShiroUtil.getCurrentUserLoginName()); // 操作员ID |
| | | // excepLog.setOperUserName(UserShiroUtil.getCurrentUserName()); // 操作员名称 |
| | | // excepLog.setOperUri(request.getRequestURI()); // 操作URI |
| | | // excepLog.setOperIp(IPUtil.getRemortIP(request)); // 操作员IP |
| | | // excepLog.setOperVer(operVer); // 操作版本号 |
| | | // excepLog.setOperCreateTime(new Date()); // 发生异常时间 |
| | | // |
| | | // exceptionLogService.insert(excepLog); |
| | | // |
| | | // } catch (Exception e2) { |
| | | // e2.printStackTrace(); |
| | | // } |
| | | // |
| | | // } |
| | | |
| | | /** |
| | | * 转换request 请求参数 |
| | | * |
| | | * @param paramMap request获取的参数数组 |
| | | */ |
| | | public Map<String, String> converMap(Map<String, String[]> paramMap) { |
| | | Map<String, String> rtnMap = new HashMap<String, String>(); |
| | | for (String key : paramMap.keySet()) { |
| | | rtnMap.put(key, paramMap.get(key)[0]); |
| | | } |
| | | return rtnMap; |
| | | } |
| | | |
| | | private String getPostData(HttpServletRequest request) { |
| | | StringBuffer data = new StringBuffer(); |
| | | String line = null; |
| | | BufferedReader reader = null; |
| | | try { |
| | | reader = request.getReader(); |
| | | while (null != (line = reader.readLine())) |
| | | data.append(line); |
| | | } catch (IOException e) { |
| | | } finally { |
| | | } |
| | | return data.toString(); |
| | | } |
| | | |
| | | /** |
| | | * 转换异常信息为字符串 |
| | | * |
| | | * @param exceptionName 异常名称 |
| | | * @param exceptionMessage 异常信息 |
| | | * @param elements 堆栈信息 |
| | | */ |
| | | public String stackTraceToString(String exceptionName, String exceptionMessage, StackTraceElement[] elements) { |
| | | StringBuffer strbuff = new StringBuffer(); |
| | | for (StackTraceElement stet : elements) { |
| | | strbuff.append(stet + "\n"); |
| | | } |
| | | String message = exceptionName + ":" + exceptionMessage + "\n\t" + strbuff.toString(); |
| | | return message; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 登录日志切入点 |
| | | */ |
| | | @Pointcut("execution(public * com.panzhihua.shop_backstage.api.LoginApi.login(..) )") |
| | | public void operLogLoginPoinCut() { |
| | | } |
| | | |
| | | /** |
| | | * 正常返回通知,拦截用户操作日志,连接点正常执行完成后执行, 如果连接点抛出异常,则不会执行 |
| | | * |
| | | * @param joinPoint 切入点 |
| | | * @param keys 返回结果 |
| | | */ |
| | | @AfterReturning(value = "operLogLoginPoinCut()", returning = "keys") |
| | | public void saveLoginOperLog(JoinPoint joinPoint, Object keys) { |
| | | log.info("进入商家后台登录日志切面"); |
| | | // 获取RequestAttributes |
| | | RequestAttributes requestAttributes = RequestContextHolder.getRequestAttributes(); |
| | | // 从获取RequestAttributes中获取HttpServletRequest的信息 |
| | | HttpServletRequest request = (HttpServletRequest) requestAttributes |
| | | .resolveReference(RequestAttributes.REFERENCE_REQUEST); |
| | | if(keys instanceof R ){ |
| | | R r = (R)keys; |
| | | if(r.getCode()==200 && "success".equals(r.getMsg())) { |
| | | |
| | | Object obj = joinPoint.getArgs(); |
| | | Object[] obja = (Object[])obj; |
| | | LoginBody loginBody = (LoginBody)obja[0]; |
| | | String userName = loginBody.getAccount(); |
| | | R<LoginUserInfoVO> userR = userService.getUserInfo(userName+"_5"); |
| | | LoginUserInfoVO loginUserInfoVO = userR.getData(); |
| | | |
| | | ShopOperLogVO shopOperlog = new ShopOperLogVO(); |
| | | try { |
| | | |
| | | // 从切面织入点处通过反射机制获取织入点处的方法 |
| | | MethodSignature signature = (MethodSignature) joinPoint.getSignature(); |
| | | // 获取切入点所在的方法 |
| | | Method method = signature.getMethod(); |
| | | // 获取操作 |
| | | ShopOperLog opLog = method.getAnnotation(ShopOperLog.class); |
| | | if (opLog != null) { |
| | | String operModul = opLog.operModul(); |
| | | int operType = opLog.operType(); |
| | | shopOperlog.setTitle(operModul); // 操作模块 |
| | | shopOperlog.setBusinessType(operType); // 操作类型 |
| | | } |
| | | // 获取请求的类名 |
| | | String className = joinPoint.getTarget().getClass().getName(); |
| | | // 获取请求的方法名 |
| | | String methodName = method.getName(); |
| | | methodName = className + "." + methodName; |
| | | |
| | | shopOperlog.setMethod(methodName); // 请求方法 |
| | | |
| | | |
| | | if (joinPoint.getArgs().length > 0) { |
| | | for (Object o : joinPoint.getArgs()) { |
| | | if (o instanceof HttpServletRequest || o instanceof HttpServletResponse) { |
| | | continue; |
| | | } |
| | | shopOperlog.setOperParam(JSONObject.toJSONString(o)); // 请求参数 |
| | | } |
| | | } |
| | | |
| | | shopOperlog.setJsonResult(JSONObject.toJSONString(keys)); // 返回结果 |
| | | shopOperlog.setAccount(loginUserInfoVO.getAccount()); |
| | | shopOperlog.setOperName(loginUserInfoVO.getName()); // 请求用户名称 |
| | | shopOperlog.setOperIp(IPUtil.getIpAddress(request)); // 请求IP |
| | | shopOperlog.setOperUrl(request.getRequestURI()); // 请求URI |
| | | shopOperlog.setRequestMethod(request.getMethod()); |
| | | shopOperlog.setOperLocation(IPUtil.getIpBelongAddress(request)); |
| | | shopOperlog.setOperTime(new Date()); // 创建时间 |
| | | shopOperlog.setAccount(loginUserInfoVO.getAccount()); |
| | | Long communityId = loginUserInfoVO.getCommunityId(); |
| | | shopOperlog.setCommunityId(null==communityId?0:communityId); |
| | | shopOperlog.setUserId(loginUserInfoVO.getUserId()); |
| | | communityService.addShopOperLog(shopOperlog); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.shop_backstage.api; |
| | | |
| | | import com.alibaba.excel.EasyExcel; |
| | | import com.alibaba.excel.ExcelWriter; |
| | | import com.alibaba.excel.write.metadata.WriteSheet; |
| | | import com.alibaba.excel.write.style.column.LongestMatchColumnWidthStyleStrategy; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.interfaces.ShopOperLog; |
| | | import com.panzhihua.common.model.dtos.shop.*; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.shop.ComShopFundsOrderVO; |
| | | import com.panzhihua.common.model.vos.shop.ShopStoreVO; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | import com.panzhihua.common.utlis.SFTPUtil; |
| | | import com.panzhihua.common.excel.CustomSheetWriteHandler; |
| | | import com.panzhihua.common.utlis.ClazzUtils; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.io.File; |
| | | import java.io.FileInputStream; |
| | | import java.io.InputStream; |
| | | import java.net.URLEncoder; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.UUID; |
| | | |
| | | /** |
| | | * @ClasssName GoodsApi 商品API |
| | | * @Description |
| | | * @Author cedoo |
| | | * @Date 2021/4/16 |
| | | * @Version 1.0 |
| | | **/ |
| | | |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/funs") |
| | | @Api(tags = {"资金管理"}) |
| | | public class FundsApi extends BaseController { |
| | | |
| | | @Resource |
| | | private CommunityService communityService; |
| | | |
| | | @Value("${excel.userurl}") |
| | | private String excelUrl; |
| | | // FTP 登录用户名 |
| | | @Value("${ftp.username}") |
| | | private String userName; |
| | | // FTP 登录密码 |
| | | @Value("${ftp.password}") |
| | | private String password; |
| | | // FTP 服务器地址IP地址 |
| | | @Value("${ftp.host}") |
| | | private String host; |
| | | // FTP 端口 |
| | | @Value("${ftp.port}") |
| | | private int port; |
| | | |
| | | @ApiOperation(value = "订单分页", response = ComShopFundsOrderVO.class) |
| | | @PostMapping("/page") |
| | | public R page(@RequestBody PageComShopFundsSearchDTO pageComShopFundsSearchDTO){ |
| | | pageComShopFundsSearchDTO.setUserId(getUserId()); |
| | | ClazzUtils.setIfStringIsEmpty(pageComShopFundsSearchDTO); |
| | | return communityService.pageShopFunds(pageComShopFundsSearchDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "资金统计信息") |
| | | @GetMapping("/stat") |
| | | public R stat(){ |
| | | return communityService.getFundsStat(getUserId()); |
| | | } |
| | | |
| | | @ApiOperation(value = "导出表格") |
| | | @PostMapping("/export") |
| | | @ShopOperLog(operType = 12) |
| | | public R export(@RequestBody ComShopFundsExportDTO comShopFundsExportDTO){ |
| | | ClazzUtils.setIfStringIsEmpty(comShopFundsExportDTO); |
| | | String url=excelUrl; |
| | | String uuid= UUID.randomUUID().toString().replace("-",""); |
| | | //String name=uuid+".xlsx"; |
| | | String ftpUrl="/mnt/data/web/excel/"; |
| | | |
| | | R<ShopStoreVO> storeR = communityService.getUserStoreInfo(getUserId()); |
| | | |
| | | if(!R.isOk(storeR)){ |
| | | return R.fail("用户不是商家"); |
| | | } |
| | | |
| | | ShopStoreVO shopStoreVO = JSONObject.parseObject(JSONObject.toJSONString(storeR.getData()),ShopStoreVO.class); |
| | | Long userId = this.getUserId(); |
| | | comShopFundsExportDTO.setUserId(userId); |
| | | R r=communityService.shopOrderFundsExportData(comShopFundsExportDTO); |
| | | if (R.isOk(r)) { |
| | | List<ExcelShopFundsDTO> excelShopFundsDTO = JSONArray.parseArray(JSONArray.toJSONString(r.getData()),ExcelShopFundsDTO.class); |
| | | if(excelShopFundsDTO==null||excelShopFundsDTO.size()==0){ |
| | | return R.ok("未找到数据"); |
| | | } |
| | | try { |
| | | SFTPUtil sftp = new SFTPUtil(userName,password,host,port); |
| | | sftp.login(); |
| | | String name = shopStoreVO.getName() +"-商家资金流水-" + new SimpleDateFormat("yyyyMMddhhmmss").format(new Date()) + ".xlsx"; |
| | | boolean existDir = sftp.isExistDir(ftpUrl+name); |
| | | if (!existDir) { |
| | | String property = System.getProperty("user.dir"); |
| | | String fileName = property + File.separator+name; |
| | | // 这里 需要指定写用哪个class去写 |
| | | ExcelWriter excelWriter = null; |
| | | InputStream inputStream=null; |
| | | try { |
| | | excelWriter = EasyExcel.write(fileName, ExcelShopFundsDTO.class).registerWriteHandler(new LongestMatchColumnWidthStyleStrategy()).registerWriteHandler(new CustomSheetWriteHandler()).build(); |
| | | WriteSheet writeSheet = EasyExcel.writerSheet(shopStoreVO.getName()+"订单").build(); |
| | | excelWriter.write(excelShopFundsDTO, writeSheet); |
| | | excelWriter.finish(); |
| | | File file=new File(fileName); |
| | | inputStream=new FileInputStream(file); |
| | | sftp.uploadMore(ftpUrl, name, inputStream); |
| | | sftp.logout(); |
| | | inputStream.close(); |
| | | String absolutePath = file.getAbsolutePath(); |
| | | boolean delete = file.delete(); |
| | | log.info("删除excel【{}】结果【{}】",absolutePath,delete); |
| | | } finally { |
| | | // 千万别忘记finish 会帮忙关闭流 |
| | | if (inputStream != null) { |
| | | inputStream.close(); |
| | | } |
| | | if (excelWriter != null) { |
| | | excelWriter.finish(); |
| | | } |
| | | } |
| | | } |
| | | return R.ok(url+ URLEncoder.encode(name,"UTF-8")); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | log.error("文件传输失败【{}】", e.getMessage()); |
| | | return R.fail(); |
| | | } |
| | | } |
| | | return R.fail("导出数据失败"); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.shop_backstage.api; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.panzhihua.common.constants.FtpConstants; |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.dtos.shop.ComShopGoodsDTO; |
| | | import com.panzhihua.common.model.dtos.shop.PageComShopGoodsDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.shop.AddShopGoodsVO; |
| | | import com.panzhihua.common.model.vos.shop.ComShopGoodsVO; |
| | | import com.panzhihua.common.model.vos.shop.ComShopOrderSearchVO; |
| | | import com.panzhihua.common.model.vos.shop.ShopStoreVO; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | import com.panzhihua.common.utlis.ClazzUtils; |
| | | import com.panzhihua.common.utlis.SFTPUtil; |
| | | import com.panzhihua.common.validated.PageGroup; |
| | | import com.panzhihua.common.interfaces.ShopOperLog; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.io.File; |
| | | import java.io.IOException; |
| | | import java.io.InputStream; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.UUID; |
| | | |
| | | /** |
| | | * @ClasssName GoodsApi 商品API |
| | | * @Description |
| | | * @Author cedoo |
| | | * @Date 2021/4/16 |
| | | * @Version 1.0 |
| | | **/ |
| | | |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/goods") |
| | | @Api(tags = {"商品管理"}) |
| | | public class GoodsApi extends BaseController { |
| | | |
| | | @Resource |
| | | private CommunityService communityService; |
| | | // FTP 登录用户名 |
| | | @Value("${ftp.username}") |
| | | private String userName; |
| | | // FTP 登录密码 |
| | | @Value("${ftp.password}") |
| | | private String password; |
| | | // FTP 服务器地址IP地址 |
| | | @Value("${ftp.host}") |
| | | private String host; |
| | | // FTP 端口 |
| | | @Value("${ftp.port}") |
| | | private int port; |
| | | @Value("${ftp.url}") |
| | | private String url; |
| | | |
| | | @ApiOperation(value = "商品分页搜索", response = ComShopGoodsVO.class) |
| | | @PostMapping("/page") |
| | | public R search(@RequestBody @Validated(PageGroup.class) PageComShopGoodsDTO comShopGoodsDTO){ |
| | | R<ShopStoreVO> storeInfoR = communityService.getUserStoreInfo(getUserId()); |
| | | if(R.isOk(storeInfoR)) { |
| | | ShopStoreVO shopStoreVO = JSONObject.parseObject(JSONObject.toJSONString(storeInfoR.getData()), ShopStoreVO.class); |
| | | if (shopStoreVO == null) { |
| | | return R.fail("用户无关联店铺"); |
| | | } |
| | | comShopGoodsDTO.setStoreId(shopStoreVO.getId()); |
| | | ClazzUtils.setIfStringIsEmpty(comShopGoodsDTO); |
| | | return communityService.pageGoodsList(comShopGoodsDTO); |
| | | }else{ |
| | | return R.fail(); |
| | | } |
| | | } |
| | | |
| | | @ApiOperation(value = "添加商品") |
| | | @ShopOperLog(operType = 3) |
| | | @PostMapping("/add") |
| | | public R search(@RequestBody @Validated AddShopGoodsVO addShopGoodsVO){ |
| | | R<ShopStoreVO> storeInofR = communityService.getUserStoreInfo(getUserId()); |
| | | |
| | | if(R.isOk(storeInofR)) { |
| | | ShopStoreVO shopStoreVO = JSONObject.parseObject(JSONObject.toJSONString(storeInofR.getData()), ShopStoreVO.class); |
| | | if (shopStoreVO == null) { |
| | | return R.fail("用户无关联店铺"); |
| | | } |
| | | addShopGoodsVO.setStoreId(shopStoreVO.getId()); |
| | | //addShopGoodsVO.setName(shopStoreVO.getName()); |
| | | return communityService.saveShopGoods(addShopGoodsVO); |
| | | }else{ |
| | | return R.fail(); |
| | | } |
| | | } |
| | | |
| | | @ApiOperation(value = "编辑商品") |
| | | @ShopOperLog(operType = 4) |
| | | @PutMapping("/edit/{id}") |
| | | R editShopGoods(@PathVariable("id") Long id,@RequestBody @Validated AddShopGoodsVO addShopGoodsVO) { |
| | | return communityService.editShopGoods(id,addShopGoodsVO); |
| | | } |
| | | |
| | | @ApiOperation(value = "下架商品") |
| | | @ShopOperLog(operType = 5) |
| | | @PutMapping("/toggleDown/{id}") |
| | | public R toggleDown(@PathVariable("id") Long id){ |
| | | return communityService.changeStatus(id,2); |
| | | } |
| | | |
| | | @ApiOperation(value = "上架商品") |
| | | @ShopOperLog(operType = 6) |
| | | @PutMapping("/toggleUp/{id}") |
| | | public R toggleUp(@PathVariable("id") Long id){ |
| | | return communityService.changeStatus(id,1); |
| | | } |
| | | |
| | | @ApiOperation(value = "删除商品") |
| | | @ShopOperLog(operType = 7) |
| | | @DeleteMapping("/delete") |
| | | R deleteShopGoods(@RequestBody Long[] id) { |
| | | return communityService.deleteShopGoods(id); |
| | | } |
| | | |
| | | @ApiOperation(value = "上传图片") |
| | | @PostMapping(value = "/uploadimage", consumes = "multipart/*", headers = "content-type=multipart/form-date") |
| | | public R uploadImage(@RequestParam MultipartFile file, HttpServletRequest request) { |
| | | String name = file.getOriginalFilename(); |
| | | List<String> formateList = Arrays.asList( |
| | | "avi", "flv", "mpg", "mpeg", "mpe", "m1v", "m2v", "mpv2", "mp2v", "dat", "ts", "tp", "tpr", "pva", "pss", "mp4", "m4v", |
| | | "m4p", "m4b", "3gp", "3gpp", "3g2", "3gp2", "ogg", "mov", "qt", "amr", "rm", "ram", "rmvb", "rpm"); |
| | | String nameStr = name.split("\\.")[1]; |
| | | if (formateList.contains(nameStr)) { |
| | | name = UUID.randomUUID().toString().replaceAll("-", "") + ".mp4"; |
| | | } else { |
| | | name = UUID.randomUUID().toString().replaceAll("-", "") + ".jpg"; |
| | | } |
| | | try { |
| | | SFTPUtil sftp = new SFTPUtil(userName, password, host, port); |
| | | sftp.login(); |
| | | InputStream is = file.getInputStream(); |
| | | sftp.uploadMore(FtpConstants.FTPFILEPATH_IDCARD, name, is); |
| | | sftp.logout(); |
| | | return R.ok(url + "/idcard/" + name); |
| | | } catch (Exception e) { |
| | | log.error("上传照片失败【{}】", e.getMessage()); |
| | | return R.fail(); |
| | | } |
| | | |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.shop_backstage.api; |
| | | |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.dtos.PageDTO; |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.shop.ShopOperLogVO; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * @ClasssName GoodsApi 商品API |
| | | * @Description |
| | | * @Author cedoo |
| | | * @Date 2021/4/16 |
| | | * @Version 1.0 |
| | | **/ |
| | | |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/log") |
| | | @Api(tags = {"操作日志"}) |
| | | public class LogApi extends BaseController { |
| | | |
| | | @Resource |
| | | private CommunityService communityService; |
| | | |
| | | @ApiOperation(value = "登陆用户操作日志", response = ShopOperLogVO.class) |
| | | @GetMapping("/page") |
| | | public R page(@RequestParam("pageNum") Long pageNum, @RequestParam("pageSize") Long pageSize){ |
| | | PageDTO pageDTO = new PageDTO(); |
| | | pageDTO.setPageNum(pageNum); |
| | | pageDTO.setPageSize(pageSize); |
| | | if(pageNum==null||new Long(0).equals(pageNum.longValue())){ |
| | | pageDTO.setPageNum(1l); |
| | | } |
| | | if(pageSize==null||new Long(0).equals(pageSize.longValue())){ |
| | | pageDTO.setPageSize(10l); |
| | | } |
| | | |
| | | LoginUserInfoVO loginUserInfoVO = this.getLoginUserInfo(); |
| | | if(loginUserInfoVO==null){ |
| | | return R.fail("未登陆"); |
| | | } |
| | | pageDTO.setUserId(loginUserInfoVO.getUserId()); |
| | | return communityService.pageShopOperLog(pageDTO); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.shop_backstage.api; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.vos.LoginReturnVO; |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.shop.LoginStoreUserInfoVO; |
| | | import com.panzhihua.common.model.vos.shop.ShopStoreVO; |
| | | import com.panzhihua.common.model.vos.user.ChangePasswordVO; |
| | | import com.panzhihua.common.service.auth.TokenService; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | import com.panzhihua.common.service.user.UserService; |
| | | import com.panzhihua.common.interfaces.ShopOperLog; |
| | | import com.panzhihua.shop_backstage.model.vos.LoginBody; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.util.ObjectUtils; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/") |
| | | @Api(tags = {"登录"}) |
| | | public class LoginApi extends BaseController { |
| | | @Resource |
| | | private TokenService tokenService; |
| | | @Resource |
| | | private UserService userService; |
| | | @Resource |
| | | private CommunityService communityService; |
| | | |
| | | @ApiOperation(value = "商家后台登录", response = LoginReturnVO.class) |
| | | @ShopOperLog(operType = 1) |
| | | @PostMapping("login") |
| | | public R login(@RequestBody LoginBody loginBody){ |
| | | String account = loginBody.getAccount(); |
| | | String password = loginBody.getPassword(); |
| | | boolean empty = ObjectUtils.isEmpty(account); |
| | | boolean empty1 = ObjectUtils.isEmpty(password); |
| | | if (empty||empty1) { |
| | | return R.fail("账户密码不能为空"); |
| | | } |
| | | log.info("登录用户信息【{}】",loginBody); |
| | | |
| | | try { |
| | | R<ShopStoreVO> storeR = communityService.getUserStoreInfoByAccount(account); |
| | | if(R.isOk(storeR)) { |
| | | ShopStoreVO shopStoreVO = JSONObject.parseObject(JSONObject.toJSONString(storeR.getData()), ShopStoreVO.class); |
| | | Boolean accountValid = shopStoreVO.getStatus() == 1; |
| | | if (accountValid) { |
| | | R r = tokenService.loginShopBackStage(account, password); |
| | | return r; |
| | | } else { |
| | | return R.fail("账号被禁用"); |
| | | } |
| | | } |
| | | return R.fail(storeR.getMsg()); |
| | | }catch (Exception e){ |
| | | return R.fail("登陆失败了"); |
| | | } |
| | | } |
| | | |
| | | @ApiOperation(value = "修改密码") |
| | | @PutMapping("changepassword") |
| | | @ShopOperLog(operType = 2) |
| | | public R changePassword(@Validated @RequestBody ChangePasswordVO changePasswordVO){ |
| | | Long userId = this.getUserId(); |
| | | String newPassword = changePasswordVO.getNewPassword(); |
| | | String oldPassword=changePasswordVO.getOldPassword(); |
| | | if (newPassword.equals(oldPassword)) { |
| | | return R.fail("修改失败,新密码和原密码一致"); |
| | | } |
| | | changePasswordVO.setUserId(userId); |
| | | return userService.changePassword(changePasswordVO); |
| | | } |
| | | |
| | | @ApiOperation(value = "当前登录用户信息",response = LoginStoreUserInfoVO.class) |
| | | @GetMapping("user") |
| | | public R detailUser(){ |
| | | Long userId = this.getUserId(); |
| | | R<LoginUserInfoVO> loginUserInfoVOR = userService.detailUser(userId); |
| | | |
| | | try { |
| | | LoginUserInfoVO loginUserInfoVO = JSONObject.parseObject(JSONObject.toJSONString(loginUserInfoVOR.getData()), LoginUserInfoVO.class); |
| | | loginUserInfoVO.setPassword("******"); |
| | | R<ShopStoreVO> storeR = communityService.getUserStoreInfo(userId); |
| | | LoginStoreUserInfoVO loginStoreUserInfoVO = new LoginStoreUserInfoVO(); |
| | | BeanUtils.copyProperties(loginUserInfoVO, loginStoreUserInfoVO); |
| | | if (R.isOk(storeR)&& storeR.getData()!=null) { |
| | | ShopStoreVO shopStoreVO = JSONObject.parseObject(JSONObject.toJSONString(storeR.getData()), ShopStoreVO.class); |
| | | loginStoreUserInfoVO.setStoreInfo(shopStoreVO); |
| | | } |
| | | return R.ok(loginStoreUserInfoVO); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return R.fail("获取登陆商家用户信息失败"); |
| | | } |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.shop_backstage.api; |
| | | |
| | | import com.alibaba.excel.EasyExcel; |
| | | import com.alibaba.excel.ExcelWriter; |
| | | import com.alibaba.excel.write.metadata.WriteSheet; |
| | | import com.alibaba.excel.write.metadata.style.WriteCellStyle; |
| | | import com.alibaba.excel.write.style.HorizontalCellStyleStrategy; |
| | | import com.alibaba.excel.write.style.column.LongestMatchColumnWidthStyleStrategy; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.dtos.shop.*; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.interfaces.ShopOperLog; |
| | | import com.panzhihua.common.model.vos.shop.ComShopOrderPageVO; |
| | | import com.panzhihua.common.model.vos.shop.ComShopOrderSearchVO; |
| | | import com.panzhihua.common.model.vos.shop.ShopStoreVO; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | import com.panzhihua.common.utlis.SFTPUtil; |
| | | import com.panzhihua.common.excel.CustomSheetWriteHandler; |
| | | import com.panzhihua.common.utlis.ClazzUtils; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.io.File; |
| | | import java.io.FileInputStream; |
| | | import java.io.InputStream; |
| | | import java.net.URLEncoder; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.UUID; |
| | | |
| | | /** |
| | | * @ClasssName GoodsApi 商品API |
| | | * @Description |
| | | * @Author cedoo |
| | | * @Date 2021/4/16 |
| | | * @Version 1.0 |
| | | **/ |
| | | |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/order") |
| | | @Api(tags = {"订单管理"}) |
| | | public class OrderApi extends BaseController { |
| | | |
| | | @Resource |
| | | private CommunityService communityService; |
| | | |
| | | @Value("${excel.userurl}") |
| | | private String excelUrl; |
| | | // FTP 登录用户名 |
| | | @Value("${ftp.username}") |
| | | private String userName; |
| | | // FTP 登录密码 |
| | | @Value("${ftp.password}") |
| | | private String password; |
| | | // FTP 服务器地址IP地址 |
| | | @Value("${ftp.host}") |
| | | private String host; |
| | | // FTP 端口 |
| | | @Value("${ftp.port}") |
| | | private int port; |
| | | |
| | | @ApiOperation(value = "订单分页", response = ComShopOrderSearchVO.class) |
| | | @PostMapping("") |
| | | public R page(@RequestBody @Validated PageComShopOrderSearchDTO pageComShopOrderSearchDTO){ |
| | | ClazzUtils.setIfStringIsEmpty(pageComShopOrderSearchDTO); |
| | | pageComShopOrderSearchDTO.setStoreUserId(this.getUserId()); |
| | | return communityService.pageShopOrder(pageComShopOrderSearchDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "取消订单") |
| | | @PutMapping("/cancel") |
| | | @ShopOperLog(operType = 8) |
| | | public R cancel(@RequestBody ComShopOrderQueryDTO comShopOrderQueryDTO){ |
| | | comShopOrderQueryDTO.setOperUserAccount(getLoginUserInfo().getAccount()); |
| | | comShopOrderQueryDTO.setIsAdmin(true); |
| | | return communityService.orderCancel(comShopOrderQueryDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "发货") |
| | | @PutMapping("/ship") |
| | | @ShopOperLog(operType = 9) |
| | | public R ship(@RequestBody ComShopOrderShipDTO orderShipDTO){ |
| | | orderShipDTO.setOperUserAccount(getLoginUserInfo().getAccount()); |
| | | orderShipDTO.setIsAdmin(false); |
| | | return communityService.shipOrder(orderShipDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "配送") |
| | | @PutMapping("/startDeliver") |
| | | @ShopOperLog(operType = 10) |
| | | public R deliver(@RequestBody ComShopOrderDeliverDTO deliverDTO){ |
| | | deliverDTO.setOperUserAccount(getLoginUserInfo().getAccount()); |
| | | deliverDTO.setIsAdmin(false); |
| | | return communityService.deliverOrder(deliverDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "配送完成") |
| | | @PutMapping("/finishDeliver") |
| | | public R finishDeliver(@RequestBody ComShopOrderDeliverDTO deliverDTO){ |
| | | deliverDTO.setOperUserAccount(getLoginUserInfo().getAccount()); |
| | | deliverDTO.setIsAdmin(false); |
| | | return communityService.finishDeliverOrder(deliverDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "订单详细",response = ComShopOrderPageVO.class) |
| | | @GetMapping("/detail") |
| | | @ShopOperLog(operType = 11) |
| | | public R detail(@RequestParam("orderId") Long orderId){ |
| | | return communityService.orderDetail(orderId); |
| | | } |
| | | |
| | | @ApiOperation(value = "导出表格") |
| | | @PostMapping("/export") |
| | | @ShopOperLog(operType = 12) |
| | | public R export(@RequestBody ComShopOrderExportDTO comShopOrderExportDTO){ |
| | | ClazzUtils.setIfStringIsEmpty(comShopOrderExportDTO); |
| | | comShopOrderExportDTO.setStoreUserId(getUserId()); |
| | | String url=excelUrl; |
| | | String uuid= UUID.randomUUID().toString().replace("-",""); |
| | | //String name=uuid+".xlsx"; |
| | | String ftpUrl="/mnt/data/web/excel/"; |
| | | |
| | | R<ShopStoreVO> storeR = communityService.getUserStoreInfo(getUserId()); |
| | | |
| | | if(!R.isOk(storeR)){ |
| | | return R.fail("用户不是商家"); |
| | | } |
| | | |
| | | ShopStoreVO shopStoreVO = JSONObject.parseObject(JSONObject.toJSONString(storeR.getData()),ShopStoreVO.class); |
| | | Long userId = this.getUserId(); |
| | | comShopOrderExportDTO.setStoreUserId(userId); |
| | | R r=communityService.shopOrderExportData(comShopOrderExportDTO); |
| | | if (R.isOk(r)) { |
| | | List<ExcelShopOrderDTO> excelShopOrderDTO = JSONArray.parseArray(JSONArray.toJSONString(r.getData()),ExcelShopOrderDTO.class); |
| | | if(excelShopOrderDTO==null||excelShopOrderDTO.size()==0){ |
| | | return R.ok("未找到数据"); |
| | | } |
| | | try { |
| | | SFTPUtil sftp = new SFTPUtil(userName,password,host,port); |
| | | sftp.login(); |
| | | String name = shopStoreVO.getName() +"商城订单-" + new SimpleDateFormat("yyyyMMddhhmmss").format(new Date()) + ".xlsx"; |
| | | boolean existDir = sftp.isExistDir(ftpUrl+name); |
| | | if (!existDir) { |
| | | String property = System.getProperty("user.dir"); |
| | | String fileName = property + File.separator+name; |
| | | // 这里 需要指定写用哪个class去写 |
| | | ExcelWriter excelWriter = null; |
| | | InputStream inputStream=null; |
| | | try { |
| | | |
| | | WriteCellStyle contentWriteCellStyle = new WriteCellStyle(); |
| | | |
| | | contentWriteCellStyle.setWrapped(true); |
| | | WriteCellStyle headWriteCellStyle = new WriteCellStyle(); |
| | | |
| | | HorizontalCellStyleStrategy horizontalCellStyleStrategy = |
| | | new HorizontalCellStyleStrategy(headWriteCellStyle, contentWriteCellStyle); |
| | | |
| | | |
| | | excelWriter = EasyExcel.write(fileName, ExcelShopOrderDTO.class).registerWriteHandler(new LongestMatchColumnWidthStyleStrategy()) |
| | | .registerWriteHandler(horizontalCellStyleStrategy).build(); |
| | | WriteSheet writeSheet = EasyExcel.writerSheet(shopStoreVO.getName()+"订单").build(); |
| | | excelWriter.write(excelShopOrderDTO, writeSheet); |
| | | excelWriter.finish(); |
| | | File file=new File(fileName); |
| | | inputStream=new FileInputStream(file); |
| | | sftp.uploadMore(ftpUrl, name, inputStream); |
| | | sftp.logout(); |
| | | inputStream.close(); |
| | | String absolutePath = file.getAbsolutePath(); |
| | | boolean delete = file.delete(); |
| | | log.info("删除excel【{}】结果【{}】",absolutePath,delete); |
| | | } finally { |
| | | // 千万别忘记finish 会帮忙关闭流 |
| | | if (inputStream != null) { |
| | | inputStream.close(); |
| | | } |
| | | if (excelWriter != null) { |
| | | excelWriter.finish(); |
| | | } |
| | | } |
| | | } |
| | | return R.ok(url+ URLEncoder.encode(name,"UTF-8")); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | log.error("文件传输失败【{}】", e.getMessage()); |
| | | return R.fail(); |
| | | } |
| | | } |
| | | return R.fail("导出数据失败"); |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.panzhihua.shop_backstage.config; |
| | | |
| | | import lombok.Data; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.context.annotation.Configuration; |
| | | |
| | | /** |
| | | * @Author: llming |
| | | * @Description: |
| | | */ |
| | | @Configuration |
| | | @Data |
| | | public class SFTPConfig { |
| | | // FTP 登录用户名 |
| | | @Value("${ftp.username}") |
| | | private String userName; |
| | | // FTP 登录密码 |
| | | @Value("${ftp.password}") |
| | | private String password; |
| | | // FTP 服务器地址IP地址 |
| | | @Value("${ftp.host}") |
| | | private String host; |
| | | // FTP 端口 |
| | | @Value("${ftp.port}") |
| | | private int port; |
| | | @Value("${ftp.url}") |
| | | private String url; |
| | | @Value("${excel.userurl}") |
| | | private String excelUrl; |
| | | } |
New file |
| | |
| | | package com.panzhihua.shop_backstage.config; |
| | | |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | import springfox.documentation.builders.ApiInfoBuilder; |
| | | import springfox.documentation.builders.PathSelectors; |
| | | import springfox.documentation.builders.RequestHandlerSelectors; |
| | | import springfox.documentation.service.ApiInfo; |
| | | import springfox.documentation.service.Contact; |
| | | import springfox.documentation.spi.DocumentationType; |
| | | import springfox.documentation.spring.web.plugins.Docket; |
| | | |
| | | /** |
| | | * @program: springcloud_k8s_panzhihuazhihuishequ |
| | | * @description: swagger3 |
| | | * @author: huang.hongfa weixin hhf9596 qq 959656820 |
| | | * @create: 2020-11-19 16:08 |
| | | **/ |
| | | @Configuration |
| | | public class SwaggerConfig { |
| | | @Bean |
| | | public Docket createRestApi() { |
| | | return new Docket(DocumentationType.SWAGGER_2) |
| | | .apiInfo(apiInfo()) |
| | | .select() |
| | | .apis(RequestHandlerSelectors.basePackage("com.panzhihua.shop_backstage")) |
| | | .paths(PathSelectors.any()) |
| | | .build(); |
| | | } |
| | | |
| | | private ApiInfo apiInfo() { |
| | | return new ApiInfoBuilder() |
| | | .title("商家后台管理接口") |
| | | .description("。") |
| | | .contact(new Contact("Ray。", "http://www.ruiyeclub.cn", "ruiyeclub@foxmail.com")) |
| | | .version("1.0") |
| | | .build(); |
| | | } |
| | | } |
New file |
| | |
| | | package com.panzhihua.shop_backstage.model.vos; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | /** |
| | | * @program: springcloud_k8s_panzhihuazhihuishequ |
| | | * @description: 登录 |
| | | * @author: huang.hongfa weixin hhf9596 qq 959656820 |
| | | * @create: 2020-11-24 10:54 |
| | | **/ |
| | | @Data |
| | | @ApiModel(value = "小程序后台登录") |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | public class LoginBody { |
| | | |
| | | @ApiModelProperty(value = "登录账户") |
| | | private String account; |
| | | @ApiModelProperty(value = "登录密码") |
| | | private String password; |
| | | |
| | | } |
New file |
| | |
| | | spring: |
| | | application: |
| | | name: shopbackstage |
| | | cloud: |
| | | config: |
| | | discovery: |
| | | enabled: true |
| | | service-id: config # 注册中心的服务名 |
| | | profile: ${ENV:dev} # 指定配置文件的环境 |
| | | uri: http://${CONFIG_URL:localhost}:8193/ |
| | | profiles: |
| | | active: ${ENV:dev} |
| | | servlet: |
| | | multipart: |
| | | max-file-size: 10MB |
| | | max-request-size: 10MB |
| | | |
| | | eureka: |
| | | client: |
| | | service-url: |
| | | defaultZone: http://${EUREKA_URL:localhost}:8192/eureka |
| | | |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <configuration debug="false"> |
| | | <!--定义日志文件的存储地址 勿在 LogBack 的配置中使用相对路径--> |
| | | <springProfile name="dev"> |
| | | <property name="LOG_HOME" value="F:/log" /> |
| | | </springProfile> |
| | | <springProfile name="test"> |
| | | <property name="LOG_HOME" value="/mnt/data/gocd/log" /> |
| | | </springProfile> |
| | | <property name="LOG_HOME" value="/mnt/data/gocd/log" /> |
| | | <!-- 控制台输出 --> |
| | | <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> |
| | | <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder"> |
| | | <!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%n是换行符--> |
| | | <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern> |
| | | </encoder> |
| | | </appender> |
| | | <!-- 按照每天生成日志文件 --> |
| | | <appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> |
| | | <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
| | | <!--日志文件输出的文件名--> |
| | | <FileNamePattern>${LOG_HOME}/shop_backstage.log.%d{yyyy-MM-dd}.log</FileNamePattern> |
| | | <!--日志文件保留天数--> |
| | | <MaxHistory>30</MaxHistory> |
| | | </rollingPolicy> |
| | | <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder"> |
| | | <!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%n是换行符--> |
| | | <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern> |
| | | </encoder> |
| | | <!--日志文件最大的大小--> |
| | | <triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy"> |
| | | <MaxFileSize>10MB</MaxFileSize> |
| | | </triggeringPolicy> |
| | | </appender> |
| | | |
| | | <!--myibatis log configure--> |
| | | <logger name="com.apache.ibatis" level="TRACE"/> |
| | | <logger name="java.sql.Connection" level="DEBUG"/> |
| | | <logger name="java.sql.Statement" level="DEBUG"/> |
| | | <logger name="java.sql.PreparedStatement" level="DEBUG"/> |
| | | <logger name="com.panzhihua.shop_backstage" level="DEBUG"/> |
| | | |
| | | <!-- 日志输出级别 --> |
| | | <root level="DEBUG"> |
| | | <appender-ref ref="STDOUT" /> |
| | | </root> |
| | | <root level="INFO"> |
| | | <appender-ref ref="STDOUT" /> |
| | | <appender-ref ref="FILE" /> |
| | | </root> |
| | | </configuration> |
| | |
| | | log.info("执行结果【{}】",r.toString()); |
| | | return ReturnT.SUCCESS; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 定时任务刷新社区活动的各个状态 除取消外 |
| | | * @return 刷新个数 |
| | | * @throws Exception 出现的异常 |
| | | */ |
| | | @XxlJob("timedTaskActActivityAllJobHandler") |
| | | public ReturnT<String> timedTaskActMicroWishAllJobHandler(String param) throws Exception { |
| | | log.info("定时任务刷新微心愿 待自动确认的状态"); |
| | | R r=communityService.timedTaskActMicroWishAll(); |
| | | log.info("执行结果【{}】",r.toString()); |
| | | return ReturnT.SUCCESS; |
| | | } |
| | | } |
| | |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.cloud.netflix.zuul.filters.Route; |
| | | import org.springframework.cloud.netflix.zuul.filters.RouteLocator; |
| | | import org.springframework.context.MessageSource; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | import org.springframework.context.annotation.Primary; |
| | |
| | | import springfox.documentation.swagger.web.SwaggerResourcesProvider; |
| | | import springfox.documentation.swagger2.annotations.EnableSwagger2; |
| | | |
| | | import java.text.MessageFormat; |
| | | import java.util.*; |
| | | |
| | | import static java.util.stream.Collectors.collectingAndThen; |
| | |
| | | //RouteLocator可以根据zuul配置的路由列表获取服务 |
| | | private final RouteLocator routeLocator; |
| | | |
| | | private String[]ids=new String[]{"appletsbackstage","applets","communitybackstage"}; |
| | | private String[]ids=new String[]{"appletsbackstage","applets","communitybackstage", "shopbackstage"}; |
| | | |
| | | public SwaggerConfig(RouteLocator routeLocator) { |
| | | this.routeLocator = routeLocator; |
| | |
| | | @Override |
| | | public List<SwaggerResource> get() { |
| | | List resources = new ArrayList(); |
| | | List<Route> routes = routeLocator.getRoutes(); |
| | | routes = routes.stream().collect( |
| | | collectingAndThen( |
| | | toCollection(() -> new TreeSet<>(Comparator.comparing(Route::getId))), ArrayList::new) |
| | | ); |
| | | //通过RouteLocator获取路由配置,遍历获取所配置服务的接口文档,这样不需要手动添加,实现动态获取 |
| | | List<String>stringList= Arrays.asList(ids); |
| | | for (Route route: routes) { |
| | | String id = route.getId(); |
| | | boolean contains = stringList.contains(id); |
| | | String fullPath = route.getFullPath(); |
| | | String s = fullPath.replaceFirst("/api", ""); |
| | | String s1 = s.replaceFirst("/" + id, ""); |
| | | if (contains) { |
| | | resources.add(swaggerResource(id,s1.replace("**", "v2/api-docs"),"1.0")); |
| | | } |
| | | } |
| | | Arrays.asList(ids).forEach(id->{ |
| | | resources.add(swaggerResource(id, MessageFormat.format("/api/{0}/v2/api-docs", id), "1.0")); |
| | | }); |
| | | return resources; |
| | | } |
| | | |
| | |
| | | boolean useragreement = requestURI.contains("useragreement");
|
| | | boolean refreshToken = requestURI.contains("refreshToken");
|
| | | boolean logout = requestURI.contains("logout");
|
| | | boolean wxPay = requestURI.contains("wxNotify");
|
| | | boolean wxCgi = requestURI.contains("cgi");
|
| | | SafeboxRequestWrapper safeboxRequestWrapper = new SafeboxRequestWrapper(request);
|
| | | if (login||doc||css||js||ui||swagger||ico||docs||error||refreshToken||useragreement) {
|
| | | if (login||doc||css||js||ui||swagger||ico||docs||error||refreshToken||useragreement||wxPay||wxCgi) {
|
| | | //什么也不做
|
| | | } else {
|
| | | // 获取请求头中JWT的Token
|
| | |
| | | boolean contains = requestUrl.contains("/api/applets/");
|
| | | boolean docs = !requestUrl.contains("docs");
|
| | | boolean login = !requestUrl.contains("login");
|
| | | boolean wxNotify = !requestUrl.contains("wxNotify");
|
| | | boolean wxCgi = !requestUrl.contains("cgi");
|
| | | boolean refreshToken = !requestUrl.contains("refreshToken");
|
| | | boolean useragreement = !requestUrl.contains("useragreement");
|
| | | if (contains&&docs&&login&&refreshToken&&useragreement) {
|
| | | if (contains&&docs&&login&&refreshToken&&useragreement&&wxNotify&&wxCgi) {
|
| | | configAttributes.add(new SecurityConfig(SecurityConstants.ROLE_APPLETS));
|
| | | }
|
| | | return configAttributes;
|