diff --git a/bweb/src/main/java/com/bweb/controller/BsUserController.java b/bweb/src/main/java/com/bweb/controller/BsUserController.java index 7d6c0ba..4bf1d7c 100644 --- a/bweb/src/main/java/com/bweb/controller/BsUserController.java +++ b/bweb/src/main/java/com/bweb/controller/BsUserController.java @@ -8,7 +8,9 @@ import com.hfkj.common.exception.ErrorHelp; import com.hfkj.common.exception.SysCode; import com.hfkj.common.utils.ResponseMsgUtil; import com.hfkj.entity.BsUser; +import com.hfkj.entity.BsUserComplaint; import com.hfkj.model.ResponseData; +import com.hfkj.service.user.BsUserComplaintService; import com.hfkj.service.user.BsUserService; import com.hfkj.service.user.impl.BsUserServiceImpl; import com.hfkj.sysenum.SecUserStatusEnum; @@ -37,6 +39,9 @@ public class BsUserController { @Resource private BsUserService userService; + @Resource + private BsUserComplaintService userComplaintService; + @RequestMapping(value="/restore",method = RequestMethod.POST) @ResponseBody @ApiOperation(value = "恢复") @@ -111,4 +116,25 @@ public class BsUserController { return ResponseMsgUtil.exception(e); } } + + @RequestMapping(value="/queryComplaintList",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "查询用户投诉列表") + public ResponseData queryComplaintList(@RequestParam(value = "name" , required = false) String name, + @RequestParam(value = "phone" , required = false) String phone, + @RequestParam(value = "pageNum" , required = true) Integer pageNum, + @RequestParam(value = "pageSize" , required = true) Integer pageSize) { + try { + Map param = new HashMap<>(); + param.put("name", name); + param.put("phone", phone); + + PageHelper.startPage(pageNum, pageSize); + return ResponseMsgUtil.success(new PageInfo<>(userComplaintService.getList(param))); + + } catch (Exception e) { + log.error("error!",e); + return ResponseMsgUtil.exception(e); + } + } } diff --git a/bweb/src/main/java/com/bweb/controller/cms/CmsContentController.java b/bweb/src/main/java/com/bweb/controller/cms/CmsContentController.java index f76e04c..8a0edb2 100644 --- a/bweb/src/main/java/com/bweb/controller/cms/CmsContentController.java +++ b/bweb/src/main/java/com/bweb/controller/cms/CmsContentController.java @@ -1,19 +1,31 @@ package com.bweb.controller.cms; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import com.hfkj.common.exception.ErrorCode; +import com.hfkj.common.exception.ErrorHelp; +import com.hfkj.common.exception.SysCode; +import com.hfkj.common.security.SessionObject; +import com.hfkj.common.utils.OrderUtil; import com.hfkj.common.utils.ResponseMsgUtil; +import com.hfkj.entity.AuditMsg; +import com.hfkj.entity.CmsContent; +import com.hfkj.entity.GoodsBrand; +import com.hfkj.entity.GoodsMsg; import com.hfkj.model.ResponseData; +import com.hfkj.model.SecUserSessionObject; import com.hfkj.service.cms.CmsContentService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; +import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.util.Date; import java.util.HashMap; import java.util.Map; @@ -27,18 +39,119 @@ public class CmsContentController { @Resource private CmsContentService cmsContentService; + @RequestMapping(value="/editCms",method = RequestMethod.POST) + @ResponseBody + @ApiOperation(value = "编辑CMS") + public ResponseData editCms(@RequestBody CmsContent body, HttpServletRequest request) { + try { + + if (body == null + || body.getPlatformCode() == null + || StringUtils.isBlank(body.getName()) + || StringUtils.isBlank(body.getCode())) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + + CmsContent cmsContent; + + if (body.getId() != null) { + // 查询CMS + cmsContent = cmsContentService.queryDetail(body.getId()); + if (cmsContent == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.CONTENT_NOT_FOUND, ""); + } + } else { + cmsContent = new CmsContent(); + cmsContent.setCreateTime(new Date()); + } + + cmsContent.setUpdateTime(new Date()); + cmsContent.setStatus(1); + cmsContent.setName(body.getName()); + cmsContent.setAppid(body.getAppid()); + cmsContent.setJumpType(body.getJumpType()); + cmsContent.setJumpUrl(body.getJumpUrl()); + cmsContent.setPlatformCode(body.getPlatformCode()); + cmsContent.setImg(body.getImg()); + cmsContent.setCode(body.getCode()); + + if (body.getId() != null) { + cmsContentService.update(cmsContent); + } else { + cmsContentService.create(cmsContent); + } + + return ResponseMsgUtil.success("操作成功"); + + } catch (Exception e) { + log.error("error!",e); + return ResponseMsgUtil.exception(e); + } + + } + @RequestMapping(value="/getCms",method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "查询列表") public ResponseData getCms(@RequestParam(value = "code" , required = false) String code, - @RequestParam(value = "platformCode" , required = false) String platformCode) { + @RequestParam(value = "name" , required = false) String name, + @RequestParam(value = "status" , required = false) Integer status, + @RequestParam(value = "platformCode" , required = false) String platformCode, + @RequestParam(value = "pageNum" , required = true) Integer pageNum, + @RequestParam(value = "pageSize" , required = true) Integer pageSize) { try { Map map = new HashMap<>(); map.put("code", code); map.put("platformCode", platformCode); + map.put("name", name); + map.put("status", status); + PageHelper.startPage(pageNum, pageSize); + return ResponseMsgUtil.success(new PageInfo<>(cmsContentService.getList(map))); + + } catch (Exception e) { + log.error("error!",e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value="/delete",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "删除") + public ResponseData delete(@RequestParam(value = "id" , required = false) Long id) { + try { + + cmsContentService.delete(id , false); + + return ResponseMsgUtil.success("删除成功"); + + } catch (Exception e) { + log.error("error!",e); + return ResponseMsgUtil.exception(e); + } + } + + + @RequestMapping(value="/cmsUpDown",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "商品上下架") + public ResponseData cmsUpDown(@RequestParam(value = "id" , required = false) Long id, HttpServletRequest request) { + try { + + CmsContent cmsContent = cmsContentService.queryDetail(id); + + if (cmsContent.getStatus() == 1) { + cmsContent.setStatus(2); + cmsContent.setUpdateTime(new Date()); + } else if (cmsContent.getStatus() == 2) { + cmsContent.setStatus(1); + cmsContent.setUpdateTime(new Date()); + + } + + cmsContentService.update(cmsContent); - return ResponseMsgUtil.success(cmsContentService.getList(map)); + return ResponseMsgUtil.success("成功"); } catch (Exception e) { log.error("error!",e); diff --git a/bweb/src/main/java/com/bweb/controller/discount/DiscountController.java b/bweb/src/main/java/com/bweb/controller/discount/DiscountController.java index d026d9b..627ecce 100644 --- a/bweb/src/main/java/com/bweb/controller/discount/DiscountController.java +++ b/bweb/src/main/java/com/bweb/controller/discount/DiscountController.java @@ -52,72 +52,79 @@ public class DiscountController { @RequestMapping(value="/editDiscount",method = RequestMethod.POST) @ResponseBody - @ApiOperation(value = "编辑商品品牌") + @ApiOperation(value = "编辑优惠券") public ResponseData editDiscount(@RequestBody CouponDiscount body, HttpServletRequest request) { - SessionObject sessionObject = userCenter.getSessionObject(request); - SecUserSessionObject userModel = (SecUserSessionObject) sessionObject.getObject(); - - if (body == null - || body.getImg() == null - || body.getType() == null - || body.getEffectiveNum() == null - || body.getEffectiveDay() == null - || body.getSalesEndTime() == null - || StringUtils.isBlank(body.getName())) { - throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); - } - if (body.getType() == 1 ){ - if ( body.getCondition() == null || body.getPrice() == null) { + try { + SessionObject sessionObject = userCenter.getSessionObject(request); + SecUserSessionObject userModel = (SecUserSessionObject) sessionObject.getObject(); + + if (body == null + || body.getImg() == null + || body.getType() == null + || body.getEffectiveNum() == null + || body.getEffectiveDay() == null + || body.getPlatformCode() == null + || body.getSalesEndTime() == null + || StringUtils.isBlank(body.getName())) { throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); } - } - if (body.getType() == 2 ){ - if (body.getPrice() == null) { - throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + if (body.getType() == 1 ){ + if ( body.getCondition() == null || body.getPrice() == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } } - } - if (body.getType() == 3){ - if ( body.getPercentage() == null) { - throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + if (body.getType() == 2 ){ + if (body.getPrice() == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + } + if (body.getType() == 3){ + if ( body.getPercentage() == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } } - } - CouponDiscount couponDiscount; + CouponDiscount couponDiscount; + + if (body.getId() != null) { + // 查询品牌 + couponDiscount = couponDiscountService.queryDetail(body.getId()); + if (couponDiscount == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.CONTENT_NOT_FOUND, ""); + } + } else { + couponDiscount = new CouponDiscount(); + couponDiscount.setCreateTime(new Date()); + couponDiscount.setLimitNum(0); + } - if (body.getId() != null) { - // 查询品牌 - couponDiscount = couponDiscountService.queryDetail(body.getId()); - if (couponDiscount == null) { - throw ErrorHelp.genException(SysCode.System, ErrorCode.CONTENT_NOT_FOUND, ""); + couponDiscount.setUpdateTime(new Date()); + couponDiscount.setStatus(1); + couponDiscount.setType(body.getType()); + couponDiscount.setEffectiveNum(body.getEffectiveNum()); + couponDiscount.setName(body.getName()); + couponDiscount.setPlatformCode(body.getPlatformCode()); + couponDiscount.setPercentage(body.getPercentage()); + couponDiscount.setPrice(body.getPrice()); + couponDiscount.setCondition(body.getCondition()); + couponDiscount.setSalesEndTime(body.getSalesEndTime()); + couponDiscount.setEffectiveDay(body.getEffectiveDay()); + couponDiscount.setImg(body.getImg()); + couponDiscount.setOpId(userModel.getAccount().getId()); + couponDiscount.setOpName(userModel.getAccount().getUserName()); + + if (body.getId() != null) { + couponDiscountService.update(couponDiscount); + } else { + couponDiscountService.create(couponDiscount); } - } else { - couponDiscount = new CouponDiscount(); - couponDiscount.setCreateTime(new Date()); - couponDiscount.setLimitNum(0); - } - couponDiscount.setUpdateTime(new Date()); - couponDiscount.setStatus(1); - couponDiscount.setType(body.getType()); - couponDiscount.setEffectiveNum(body.getEffectiveNum()); - couponDiscount.setName(body.getName()); - couponDiscount.setPercentage(body.getPercentage()); - couponDiscount.setPrice(body.getPrice()); - couponDiscount.setCondition(body.getCondition()); - couponDiscount.setSalesEndTime(body.getSalesEndTime()); - couponDiscount.setEffectiveDay(body.getEffectiveDay()); - couponDiscount.setImg(body.getImg()); - couponDiscount.setOpId(userModel.getAccount().getId()); - couponDiscount.setOpName(userModel.getAccount().getUserName()); - - if (body.getId() != null) { - couponDiscountService.update(couponDiscount); - } else { - couponDiscountService.create(couponDiscount); + return ResponseMsgUtil.success("操作成功"); + } catch (Exception e) { + log.error("error!",e); + return ResponseMsgUtil.exception(e); } - - return ResponseMsgUtil.success("操作成功"); } @@ -127,6 +134,7 @@ public class DiscountController { public ResponseData getListDiscount(@RequestParam(value = "name" , required = false) String name, @RequestParam(value = "type" , required = false) Integer type, @RequestParam(value = "status" , required = false) Integer status, + @RequestParam(value = "platformCode" , required = false) String platformCode, @RequestParam(value = "pageNum" , required = true) Integer pageNum, @RequestParam(value = "pageSize" , required = true) Integer pageSize) { try { @@ -135,6 +143,7 @@ public class DiscountController { map.put("name", name); map.put("type", type); map.put("status", status); + map.put("platformCode", platformCode); PageHelper.startPage(pageNum, pageSize); return ResponseMsgUtil.success(new PageInfo<>(couponDiscountService.getList(map))); @@ -200,27 +209,34 @@ public class DiscountController { @ApiOperation(value = "绑定优惠券规格") public ResponseData bindDiscountSpecs(@RequestBody JSONObject body) { - if (body == null - || body.getLong("discountId") == null - || StringUtils.isBlank(body.getString("specsIds"))) { - throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); - } + try { + + if (body == null + || body.getLong("discountId") == null + || StringUtils.isBlank(body.getString("specsIds"))) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + + couponDiscountService.deleteDiscountGoodsRelDiscountId(body.getLong("discountId")); - couponDiscountService.deleteDiscountGoodsRelDiscountId(body.getLong("discountId")); + String[] specsIds = body.getString("specsIds").split(","); - String[] specsIds = body.getString("specsIds").split(","); + for (String specsId : specsIds) { + CouponDiscountGoodsRel goodsRel = new CouponDiscountGoodsRel(); + goodsRel.setDiscountId(body.getLong("discountId")); + goodsRel.setSpecsId(Long.valueOf(specsId)); + goodsRel.setCreateTime(new Date()); + goodsRel.setStatus(1); - for (String specsId : specsIds) { - CouponDiscountGoodsRel goodsRel = new CouponDiscountGoodsRel(); - goodsRel.setDiscountId(body.getLong("discountId")); - goodsRel.setSpecsId(Long.valueOf(specsId)); - goodsRel.setCreateTime(new Date()); - goodsRel.setStatus(1); + couponDiscountService.createGoodsRel(goodsRel); + } - couponDiscountService.createGoodsRel(goodsRel); + return ResponseMsgUtil.success("操作成功"); + } catch (Exception e) { + log.error("error!",e); + return ResponseMsgUtil.exception(e); } - return ResponseMsgUtil.success("操作成功"); } diff --git a/bweb/src/main/java/com/bweb/controller/goods/GoodsBrandController.java b/bweb/src/main/java/com/bweb/controller/goods/GoodsBrandController.java index 9067b20..a86a3ae 100644 --- a/bweb/src/main/java/com/bweb/controller/goods/GoodsBrandController.java +++ b/bweb/src/main/java/com/bweb/controller/goods/GoodsBrandController.java @@ -49,7 +49,6 @@ public class GoodsBrandController { SecUserSessionObject userModel = (SecUserSessionObject) sessionObject.getObject(); if (body == null - || body.getImgUrl() == null || StringUtils.isBlank(body.getTitle())) { throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); } diff --git a/bweb/src/main/java/com/bweb/controller/goods/GoodsController.java b/bweb/src/main/java/com/bweb/controller/goods/GoodsController.java index da39b4f..d6b462e 100644 --- a/bweb/src/main/java/com/bweb/controller/goods/GoodsController.java +++ b/bweb/src/main/java/com/bweb/controller/goods/GoodsController.java @@ -71,11 +71,6 @@ public class GoodsController { SessionObject sessionObject = userCenter.getSessionObject(request); SecUserSessionObject userModel = (SecUserSessionObject) sessionObject.getObject(); - if (userModel.getAccount().getObjectType() != SecUserObjectTypeEnum.type2.getCode()) { - throw ErrorHelp.genException(SysCode.System, ErrorCode.ROLE_NOT_PERMISSIONS, ""); - - } - if (body == null || body.getGoodsBrand() == null || body.getGoodsType() == null @@ -99,6 +94,9 @@ public class GoodsController { goodsMsg = new GoodsMsg(); goodsMsg.setCreateTime(new Date()); goodsMsg.setSaleNum(0); + goodsMsg.setMerId(userModel.getAccount().getObjectId()); + goodsMsg.setMerName(userModel.getAccount().getUserName()); + body.setStatus(2); } GoodsType goodsType = goodsTypeService.queryDetail(body.getGoodsType()); @@ -106,7 +104,6 @@ public class GoodsController { if (goodsType.getParentId() == null) { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "一级分类不可选择!"); } - goodsMsg.setUpdateTime(new Date()); goodsMsg.setGoodsBrandName(goodsBrandService.findGoodsBrandName(body.getGoodsBrand())); goodsMsg.setGoodsTypeName(goodsTypeService.findGoodsType(body.getGoodsType())); @@ -115,15 +112,13 @@ public class GoodsController { goodsMsg.setGoodsTypeParentName(goodsTypeService.findGoodsType(goodsType.getParentId())); goodsMsg.setType(body.getType()); goodsMsg.setGoodsBrand(body.getGoodsBrand()); - goodsMsg.setStatus(2); + goodsMsg.setStatus(body.getStatus()); goodsMsg.setTitle(body.getTitle()); goodsMsg.setGoodsExplain(body.getGoodsExplain()); goodsMsg.setGoodsLabel(body.getGoodsLabel()); goodsMsg.setListImg(body.getListImg()); goodsMsg.setBannerImg(body.getBannerImg()); goodsMsg.setDetailImg(body.getDetailImg()); - goodsMsg.setMerId(userModel.getAccount().getObjectId()); - goodsMsg.setMerName(userModel.getAccount().getUserName()); if (body.getId() != null) { goodsMsgService.update(goodsMsg); @@ -241,6 +236,9 @@ public class GoodsController { } } + goodsMsg.setStatus(2); + goodsMsgService.update(goodsMsg); + return ResponseMsgUtil.success("操作成功"); } catch (Exception e) { diff --git a/bweb/src/main/java/com/bweb/controller/goods/GoodsTypeController.java b/bweb/src/main/java/com/bweb/controller/goods/GoodsTypeController.java index 454b91e..3b5895c 100644 --- a/bweb/src/main/java/com/bweb/controller/goods/GoodsTypeController.java +++ b/bweb/src/main/java/com/bweb/controller/goods/GoodsTypeController.java @@ -66,6 +66,7 @@ public class GoodsTypeController { goodsType.setStatus(1); goodsType.setTitle(body.getTitle()); goodsType.setParentId(body.getParentId()); + goodsType.setSort(body.getSort()); goodsType.setBusinessType(body.getBusinessType()); goodsType.setImgUrl(body.getImgUrl()); goodsType.setOpId(userModel.getAccount().getId()); diff --git a/cweb/src/main/java/com/cweb/controller/cms/CmsContentController.java b/cweb/src/main/java/com/cweb/controller/cms/CmsContentController.java index 28e6fd6..04ebef6 100644 --- a/cweb/src/main/java/com/cweb/controller/cms/CmsContentController.java +++ b/cweb/src/main/java/com/cweb/controller/cms/CmsContentController.java @@ -36,8 +36,10 @@ public class CmsContentController { Map map = new HashMap<>(); map.put("code", code); + if (platformCode == null) { + platformCode = "WXAPPLETS"; + } map.put("platformCode", platformCode); - return ResponseMsgUtil.success(cmsContentService.getList(map)); } catch (Exception e) { diff --git a/cweb/src/main/java/com/cweb/controller/discount/DiscountController.java b/cweb/src/main/java/com/cweb/controller/discount/DiscountController.java index 9cfd812..2637692 100644 --- a/cweb/src/main/java/com/cweb/controller/discount/DiscountController.java +++ b/cweb/src/main/java/com/cweb/controller/discount/DiscountController.java @@ -18,6 +18,7 @@ import com.hfkj.service.discount.CouponDiscountService; import com.hfkj.service.discount.CouponDiscountUserRelService; import com.hfkj.service.goods.impl.GoodsMsgServiceImpl; import com.hfkj.service.goods.impl.GoodsSpecsServiceImpl; +import com.hfkj.sysenum.UserLoginPlatform; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.apache.commons.lang3.StringUtils; @@ -76,7 +77,9 @@ public class DiscountController { @RequestMapping(value = "/getGoodsDiscount", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "获取商品可用优惠券") - public ResponseData getGoodsDiscount(@RequestParam(value = "specsIds", required = true) String specsIds) { + public ResponseData getGoodsDiscount(@RequestParam(value = "specsIds", required = true) String specsIds, + @RequestParam(value = "platformCode" , required = false) String platformCode + ) { try { // 用户session @@ -85,6 +88,12 @@ public class DiscountController { Map map = new HashMap<>(); map.put("userId", userSession.getUser().getId()); + if (platformCode == null) { + map.put("platformCode", UserLoginPlatform.WXAPPLETS.getCode()); + } else { + map.put("platformCode", platformCode); + } + map.put("status", 1); List list = discountUserRelService.getList(map); diff --git a/cweb/src/main/java/com/cweb/controller/goods/GoodsController.java b/cweb/src/main/java/com/cweb/controller/goods/GoodsController.java index fccb6c9..25cf899 100644 --- a/cweb/src/main/java/com/cweb/controller/goods/GoodsController.java +++ b/cweb/src/main/java/com/cweb/controller/goods/GoodsController.java @@ -65,7 +65,9 @@ public class GoodsController { public ResponseData getListGoodsType() { try { - List list = goodsTypeService.getList(new HashMap<>()); + Map map = new HashMap<>(); + map.put("status" , 1); + List list = goodsTypeService.getList(map); List goodsTypeModels = goodsTypeService.getGoodsTypeModelList(list); diff --git a/order/src/main/java/com/order/controller/OrderPayController.java b/order/src/main/java/com/order/controller/OrderPayController.java index 7dacf46..d43218b 100644 --- a/order/src/main/java/com/order/controller/OrderPayController.java +++ b/order/src/main/java/com/order/controller/OrderPayController.java @@ -198,10 +198,10 @@ public class OrderPayController { if (bsUserLoginLog != null) { - bsOrderOutside.setPlatformCode(bsOrderOutside.getPlatformCode()); - bsOrderOutside.setPlatformName(bsOrderOutside.getPlatformName()); - bsOrderOutside.setLoginTypeCode(bsOrderOutside.getLoginTypeCode()); - bsOrderOutside.setLoginTypeName(bsOrderOutside.getLoginTypeName()); + bsOrderOutside.setPlatformCode(bsUserLoginLog.getPlatformCode()); + bsOrderOutside.setPlatformName(bsUserLoginLog.getPlatformName()); + bsOrderOutside.setLoginTypeCode(bsUserLoginLog.getLoginTypeCode()); + bsOrderOutside.setLoginTypeName(bsUserLoginLog.getLoginTypeName()); } bsOrderOutside.setOrderNo(order.getOrderNo()); bsOrderOutside.setStatus(1); diff --git a/service/src/main/java/com/hfkj/model/order/OrderModel.java b/service/src/main/java/com/hfkj/model/order/OrderModel.java index 37c3a44..8e6b3c4 100644 --- a/service/src/main/java/com/hfkj/model/order/OrderModel.java +++ b/service/src/main/java/com/hfkj/model/order/OrderModel.java @@ -38,4 +38,9 @@ public class OrderModel extends BsOrder { */ private List orderChildList; + /** + * 子订单列表 + */ + private String platformCode; + } diff --git a/service/src/main/java/com/hfkj/service/cms/impl/CmsContentServiceImpl.java b/service/src/main/java/com/hfkj/service/cms/impl/CmsContentServiceImpl.java index 2a133b5..d28f9d8 100644 --- a/service/src/main/java/com/hfkj/service/cms/impl/CmsContentServiceImpl.java +++ b/service/src/main/java/com/hfkj/service/cms/impl/CmsContentServiceImpl.java @@ -52,12 +52,18 @@ public class CmsContentServiceImpl implements CmsContentService { if (StringUtils.isNotBlank(MapUtils.getString(map, "code"))) { criteria.andCodeEqualTo(MapUtils.getString(map, "code")); } + if (StringUtils.isNotBlank(MapUtils.getString(map, "name"))) { + criteria.andNameEqualTo(MapUtils.getString(map, "name")); + } + if (MapUtils.getInteger(map, "status") != null) { + criteria.andStatusEqualTo(MapUtils.getInteger(map, "status")); + } else { + criteria.andStatusNotEqualTo(0); + } if (StringUtils.isNotBlank(MapUtils.getString(map, "platformCode"))) { criteria.andPlatformCodeEqualTo(MapUtils.getString(map, "platformCode")); - }else { - criteria.andPlatformCodeEqualTo("H5"); } - criteria.andStatusNotEqualTo(0); + return cmsContentMapper.selectByExample(example); } } diff --git a/service/src/main/java/com/hfkj/service/discount/CouponDiscountPackageService.java b/service/src/main/java/com/hfkj/service/discount/CouponDiscountPackageService.java index 107ef23..c6ca6b7 100644 --- a/service/src/main/java/com/hfkj/service/discount/CouponDiscountPackageService.java +++ b/service/src/main/java/com/hfkj/service/discount/CouponDiscountPackageService.java @@ -111,6 +111,14 @@ public interface CouponDiscountPackageService { void deleteDetail(Integer id); + /** + * @MethodName giveDiscountPackage + * @Description: 赠送优惠券包 + * @param discountPackageId + * @param phone + * @Author: Sum1Dream + * @Date: 2024/7/17 下午3:01 + */ void giveDiscountPackage(Integer discountPackageId , String phone); } diff --git a/service/src/main/java/com/hfkj/service/discount/impl/CouponDiscountPackageServiceImpl.java b/service/src/main/java/com/hfkj/service/discount/impl/CouponDiscountPackageServiceImpl.java index ef58e00..e5ede3f 100644 --- a/service/src/main/java/com/hfkj/service/discount/impl/CouponDiscountPackageServiceImpl.java +++ b/service/src/main/java/com/hfkj/service/discount/impl/CouponDiscountPackageServiceImpl.java @@ -182,6 +182,7 @@ public class CouponDiscountPackageServiceImpl implements CouponDiscountPackageSe discountUserRel = new CouponDiscountUserRel(); discountUserRel.setDiscountId(Long.valueOf(detail.getDiscountId())); discountUserRel.setDiscountImg(detail.getDiscountImg()); + discountUserRel.setPlatformCode(discount.getPlatformCode()); discountUserRel.setDiscountName(detail.getDiscountName()); discountUserRel.setDiscountCondition(discount.getCondition()); discountUserRel.setDiscountPrice(discount.getPrice()); diff --git a/service/src/main/java/com/hfkj/service/discount/impl/CouponDiscountServiceImpl.java b/service/src/main/java/com/hfkj/service/discount/impl/CouponDiscountServiceImpl.java index 9a62ba6..3eb4b3c 100644 --- a/service/src/main/java/com/hfkj/service/discount/impl/CouponDiscountServiceImpl.java +++ b/service/src/main/java/com/hfkj/service/discount/impl/CouponDiscountServiceImpl.java @@ -64,6 +64,9 @@ public class CouponDiscountServiceImpl implements CouponDiscountService { if (StringUtils.isNotBlank(MapUtils.getString(map, "name"))) { criteria.andNameLike("%"+MapUtils.getString(map, "name")+"%"); } + if (MapUtils.getString(map, "platformCode") != null) { + criteria.andPlatformCodeEqualTo(MapUtils.getString(map, "platformCode")); + } if (MapUtils.getInteger(map, "status") != null) { criteria.andStatusEqualTo(MapUtils.getInteger(map, "status")); } else { diff --git a/service/src/main/java/com/hfkj/service/discount/impl/CouponDiscountUserRelServiceImpl.java b/service/src/main/java/com/hfkj/service/discount/impl/CouponDiscountUserRelServiceImpl.java index 861c90c..e86ef90 100644 --- a/service/src/main/java/com/hfkj/service/discount/impl/CouponDiscountUserRelServiceImpl.java +++ b/service/src/main/java/com/hfkj/service/discount/impl/CouponDiscountUserRelServiceImpl.java @@ -35,7 +35,6 @@ public class CouponDiscountUserRelServiceImpl implements CouponDiscountUserRelSe CouponDiscountUserRelExample example = new CouponDiscountUserRelExample(); CouponDiscountUserRelExample.Criteria criteria = example.createCriteria(); - if (MapUtils.getInteger(map, "userId") != null) { criteria.andUserIdEqualTo(MapUtils.getLong(map, "userId")); } @@ -43,6 +42,9 @@ public class CouponDiscountUserRelServiceImpl implements CouponDiscountUserRelSe if (MapUtils.getInteger(map, "status") != null) { criteria.andStatusEqualTo(MapUtils.getInteger(map, "status")); } + if (MapUtils.getInteger(map, "platformCode") != null) { + criteria.andPlatformCodeEqualTo(MapUtils.getString(map, "platformCode")); + } return couponDiscountUserRelMapper.selectByExample(example); } diff --git a/service/src/main/java/com/hfkj/service/goods/impl/GoodsBrandServiceImpl.java b/service/src/main/java/com/hfkj/service/goods/impl/GoodsBrandServiceImpl.java index 534858c..f8b82df 100644 --- a/service/src/main/java/com/hfkj/service/goods/impl/GoodsBrandServiceImpl.java +++ b/service/src/main/java/com/hfkj/service/goods/impl/GoodsBrandServiceImpl.java @@ -26,7 +26,7 @@ public class GoodsBrandServiceImpl implements GoodsBrandService { @Override public void update(GoodsBrand GoodsBrand) { - goodsBrandMapper.updateByPrimaryKeySelective(GoodsBrand); + goodsBrandMapper.updateByPrimaryKey(GoodsBrand); } @Override diff --git a/service/src/main/java/com/hfkj/service/goods/impl/GoodsTypeServiceImpl.java b/service/src/main/java/com/hfkj/service/goods/impl/GoodsTypeServiceImpl.java index 90151ec..206df15 100644 --- a/service/src/main/java/com/hfkj/service/goods/impl/GoodsTypeServiceImpl.java +++ b/service/src/main/java/com/hfkj/service/goods/impl/GoodsTypeServiceImpl.java @@ -89,6 +89,12 @@ public class GoodsTypeServiceImpl implements GoodsTypeService { if (MapUtils.getInteger(map, "businessType") != null) { criteria.andBusinessTypeEqualTo(MapUtils.getInteger(map, "businessType")); } + if (MapUtils.getInteger(map, "status") != null) { + criteria.andStatusEqualTo(MapUtils.getInteger(map, "status")); + } else { + criteria.andStatusNotEqualTo(0); + } + example.setOrderByClause("sort asc"); return goodsTypeMapper.selectByExample(example); } diff --git a/service/src/main/java/com/hfkj/service/order/impl/BsOrderServiceImpl.java b/service/src/main/java/com/hfkj/service/order/impl/BsOrderServiceImpl.java index cb93047..09880fe 100644 --- a/service/src/main/java/com/hfkj/service/order/impl/BsOrderServiceImpl.java +++ b/service/src/main/java/com/hfkj/service/order/impl/BsOrderServiceImpl.java @@ -89,6 +89,7 @@ public class BsOrderServiceImpl implements BsOrderService { private BsProductConfigService productConfigService; + @Override public BsOrder editData(BsOrder order) { order.setUpdateTime(new Date()); diff --git a/service/src/main/java/com/hfkj/service/user/BsUserComplaintService.java b/service/src/main/java/com/hfkj/service/user/BsUserComplaintService.java new file mode 100644 index 0000000..a0283e6 --- /dev/null +++ b/service/src/main/java/com/hfkj/service/user/BsUserComplaintService.java @@ -0,0 +1,68 @@ +package com.hfkj.service.user; + +import com.hfkj.entity.BsUserComplaint; + +import java.util.List; +import java.util.Map; + +public interface BsUserComplaintService { + + /** + * @MethodName create + * @Description: 创建 + * @param userComplaint + * @Author: Sum1Dream + * @Date: 2024/7/18 下午5:36 + */ + void create(BsUserComplaint userComplaint); + + /** + * @MethodName update + * @Description: 更新 + * @param userComplaint + * @Author: Sum1Dream + * @Date: 2024/7/18 下午5:36 + */ + void update(BsUserComplaint userComplaint); + + /** + * @MethodName delete + * @Description: 删除 + * @param id + * @param fullDelete + * @Author: Sum1Dream + * @Date: 2024/7/18 下午5:37 + */ + void delete(Long id , Boolean fullDelete); + + /** + * @MethodName queryDetail + * @Description: 查询详情 + * @param id + * @return: com.hfkj.entity.BsUserComplaint + * @Author: Sum1Dream + * @Date: 2024/7/18 下午5:37 + */ + BsUserComplaint queryDetail(Long id); + + /** + * @MethodName queryDetailByMap + * @Description: + * @param map + * @return: com.hfkj.entity.BsUserComplaint + * @Author: Sum1Dream + * @Date: 2024/7/18 下午5:37 + */ + BsUserComplaint queryDetailByMap(Map map); + + /** + * @MethodName getList + * @Description: 查询列表 + * @param map + * @return: java.util.List + * @Author: Sum1Dream + * @Date: 2024/7/18 下午5:37 + */ + List getList(Map map); + +} diff --git a/service/src/main/java/com/hfkj/service/user/impl/BsUserComplaintServiceImpl.java b/service/src/main/java/com/hfkj/service/user/impl/BsUserComplaintServiceImpl.java new file mode 100644 index 0000000..8f83939 --- /dev/null +++ b/service/src/main/java/com/hfkj/service/user/impl/BsUserComplaintServiceImpl.java @@ -0,0 +1,68 @@ +package com.hfkj.service.user.impl; + +import com.hfkj.dao.BsUserComplaintMapper; +import com.hfkj.entity.BsUserComplaint; +import com.hfkj.entity.BsUserComplaintExample; +import com.hfkj.service.user.BsUserComplaintService; +import org.apache.commons.collections4.MapUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.Date; +import java.util.List; +import java.util.Map; + +@Service("bsUserComplaintService") +public class BsUserComplaintServiceImpl implements BsUserComplaintService { + + @Resource + private BsUserComplaintMapper bsUserComplaintMapper; + + @Override + public void create(BsUserComplaint userComplaint) { + bsUserComplaintMapper.insert(userComplaint); + } + + @Override + public void update(BsUserComplaint userComplaint) { + bsUserComplaintMapper.updateByPrimaryKeySelective(userComplaint); + } + + @Override + public void delete(Long id, Boolean fullDelete) { + if (fullDelete) { + bsUserComplaintMapper.deleteByPrimaryKey(id); + } else { + BsUserComplaint bsUserComplaint = queryDetail(id); + bsUserComplaint.setUpdateTime(new Date()); + update(bsUserComplaint); + } + } + + @Override + public BsUserComplaint queryDetail(Long id) { + return bsUserComplaintMapper.selectByPrimaryKey(id); + } + + @Override + public BsUserComplaint queryDetailByMap(Map map) { + return null; + } + + @Override + public List getList(Map map) { + BsUserComplaintExample bsUserComplaintExample = new BsUserComplaintExample(); + BsUserComplaintExample.Criteria criteria = bsUserComplaintExample.createCriteria(); + + if (StringUtils.isNotBlank(MapUtils.getString(map, "name"))) { + criteria.andNameLike("%"+MapUtils.getString(map, "name")+"%"); + } + + if (StringUtils.isNotBlank(MapUtils.getString(map, "phone"))) { + criteria.andPhoneLike("%"+MapUtils.getString(map, "phone")+"%"); + } + + return bsUserComplaintMapper.selectByExample(bsUserComplaintExample); + } +} diff --git a/user/src/main/java/com/user/controller/BsUserController.java b/user/src/main/java/com/user/controller/BsUserController.java index 24706ec..2266847 100644 --- a/user/src/main/java/com/user/controller/BsUserController.java +++ b/user/src/main/java/com/user/controller/BsUserController.java @@ -10,11 +10,15 @@ import com.hfkj.common.security.UserCenter; import com.hfkj.common.utils.*; import com.hfkj.config.WxMaConfig; import com.hfkj.entity.BsUser; +import com.hfkj.entity.BsUserComplaint; import com.hfkj.model.ResponseData; import com.hfkj.model.SecUserSessionObject; import com.hfkj.model.UserSessionObject; import com.hfkj.service.SecUserService; +import com.hfkj.service.user.BsUserComplaintService; import com.hfkj.service.user.BsUserService; +import com.hfkj.service.user.impl.BsUserServiceImpl; +import com.hfkj.sysenum.SecUserStatusEnum; import com.hfkj.sysenum.UserLoginPlatform; import com.hfkj.sysenum.UserLoginType; import io.swagger.annotations.Api; @@ -52,6 +56,8 @@ public class BsUserController { private UserCenter userCenter; @Resource private RedisUtil redisUtil; + @Resource + private BsUserComplaintService userComplaintService; @RequestMapping(value = "/phone", method = RequestMethod.POST) @ResponseBody @@ -261,6 +267,53 @@ public class BsUserController { } } + @RequestMapping(value = "/editUser", method = RequestMethod.POST) + @ResponseBody + @ApiOperation(value = "编辑用户信息") + public ResponseData editUser(@RequestBody BsUser body) { + try { + + UserSessionObject userSession = userCenter.getSessionModel(UserSessionObject.class); + BsUser bsUser = userSession.getUser(); + + bsUser.setHeadImg(body.getHeadImg()); + bsUser.setPhone(body.getPhone()); + + userService.editData(bsUser); + + return ResponseMsgUtil.success("修改成功"); + + } catch (Exception e) { + log.error("LoginController --> wechatMaPhone() error!", e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value="/disable",method = RequestMethod.POST) + @ResponseBody + @ApiOperation(value = "禁用") + public ResponseData disable() { + try { + UserSessionObject userSession = userCenter.getSessionModel(UserSessionObject.class); + // 查询用户详情 + BsUser user = userSession.getUser(); + if (user == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + user.setStatus(SecUserStatusEnum.status2.getCode()); + userService.editData(user); + + // 退出当前登录信息 + userService.loginOut(new BsUserServiceImpl().token(user)); + + return ResponseMsgUtil.success("操作成功"); + + } catch (Exception e) { + log.error("error!",e); + return ResponseMsgUtil.exception(e); + } + } + @RequestMapping(value="/loginOut",method = RequestMethod.POST) @ResponseBody @@ -279,4 +332,33 @@ public class BsUserController { } } + @RequestMapping(value = "/postComplaint", method = RequestMethod.POST) + @ResponseBody + @ApiOperation(value = "提交意见") + public ResponseData postComplaint(@RequestBody BsUserComplaint body) { + try { + + UserSessionObject userSession = userCenter.getSessionModel(UserSessionObject.class); + BsUser bsUser = userSession.getUser(); + + BsUserComplaint bsUserComplaint = new BsUserComplaint(); + bsUserComplaint.setUserId(bsUser.getId()); + bsUserComplaint.setContent(body.getContent()); + bsUserComplaint.setCreateTime(new Date()); + bsUserComplaint.setUpdateTime(new Date()); + bsUserComplaint.setPhone(bsUser.getPhone()); + bsUserComplaint.setName(bsUser.getName()); + + userComplaintService.create(bsUserComplaint); + + return ResponseMsgUtil.success("成功"); + + } catch (Exception e) { + log.error("LoginController --> wechatMaPhone() error!", e); + return ResponseMsgUtil.exception(e); + } + } + + + }