| | |
| | | @Autowired |
| | | private CommentService commentService; |
| | | |
| | | @ApiOperation("根据ID删除") |
| | | @GetMapping("/delete/{id}") |
| | | @RequiresPermissions("business:comment:delete") |
| | | public ApiResponse deleteById(@PathVariable Integer id) { |
| | | commentService.deleteById(id); |
| | | return ApiResponse.success(null); |
| | | } |
| | | // @ApiOperation("根据ID删除") |
| | | // @GetMapping("/delete/{id}") |
| | | // @RequiresPermissions("business:comment:delete") |
| | | // public ApiResponse deleteById(@PathVariable Integer id) { |
| | | // commentService.deleteById(id); |
| | | // return ApiResponse.success(null); |
| | | // } |
| | | |
| | | @ApiOperation("批量删除") |
| | | @GetMapping("/delete/batch") |
| | |
| | | # application: |
| | | # name: doumeemes |
| | | profiles: |
| | | active: dev |
| | | active: pro |
| | | |
| | | # JSON返回配置 |
| | | jackson: |
| | |
| | | package com.doumee.config.Jwt; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.doumee.config.annotation.LoginRequired; |
| | | import com.doumee.config.annotation.LoginShopRequired; |
| | | import com.doumee.core.constants.ResponseStatus; |
| | | import com.doumee.core.exception.BusinessException; |
| | | import com.doumee.core.utils.Constants; |
| | | import com.doumee.dao.business.model.Member; |
| | | import com.doumee.dao.business.model.Shop; |
| | | import io.jsonwebtoken.JwtException; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.lang.reflect.Method; |
| | | import java.util.Objects; |
| | | |
| | | @Configuration |
| | | public class WebMvcConfig implements WebMvcConfigurer { |
| | |
| | | if(StringUtils.isBlank(tokenRedis)){ |
| | | throw new BusinessException(ResponseStatus.NO_LOGIN.getCode(),"未登录"); |
| | | } |
| | | Member member = JSONObject.parseObject(tokenRedis, Member.class); |
| | | if(Objects.isNull(member)||StringUtils.isBlank(member.getOpenId())){ |
| | | throw new BusinessException(ResponseStatus.NO_LOGIN.getCode(),"未登录"); |
| | | } |
| | | String openid = member.getOpenId(); |
| | | Integer memberId = getTokenId(token); |
| | | Integer isDeleted = dao.queryForObject(" select COALESCE(ISDELETED,0) from Member where id = ?", Integer.class, memberId); |
| | | if(isDeleted== Constants.ONE){ |
| | |
| | | } |
| | | if(isForbidden == Constants.TWO){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"用户已注销,请联系管理员"); |
| | | } |
| | | String dbOpenid = dao.queryForObject(" select ifnull(open_id,'') from Member where id = ?", String.class, memberId); |
| | | if(StringUtils.isBlank(dbOpenid)||!openid.equals(dbOpenid)){ |
| | | throw new BusinessException(ResponseStatus.NO_LOGIN.getCode(),"已过期,请重新登录"); |
| | | } |
| | | Integer count = dao.queryForObject("select count(1) from Member where id = ?", Integer.class, memberId); |
| | | if (count != null && count > 0) { |
| | |
| | | if(StringUtils.isBlank(tokenRedis)){ |
| | | throw new BusinessException(ResponseStatus.NO_LOGIN.getCode(),"未登录"); |
| | | } |
| | | Shop shop = JSONObject.parseObject(tokenRedis, Shop.class); |
| | | if(Objects.isNull(shop)||StringUtils.isBlank(shop.getOpenId())){ |
| | | throw new BusinessException(ResponseStatus.NO_LOGIN.getCode(),"未登录"); |
| | | } |
| | | String openid = shop.getOpenId(); |
| | | Integer shopId = getTokenId(token); |
| | | Integer isDeleted = dao.queryForObject(" select COALESCE(ISDELETED,0) from shop where id = ?", Integer.class, shopId); |
| | | if(isDeleted== Constants.ONE){ |
| | |
| | | if(isForbidden== Constants.ONE){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"用户已禁用,请联系管理员"); |
| | | } |
| | | String dbOpenid = dao.queryForObject(" select ifnull(open_id,'') from shop where id = ?", String.class, shopId); |
| | | if(StringUtils.isBlank(dbOpenid)||!openid.equals(dbOpenid)){ |
| | | throw new BusinessException(ResponseStatus.NO_LOGIN.getCode(),"已过期,请重新登录"); |
| | | } |
| | | Integer count = dao.queryForObject("select count(1) from shop where id = ?", Integer.class, shopId); |
| | | if (count != null && count > 0) { |
| | | request.setAttribute(JwtTokenUtil.ShopId_Name, shopId); |
| | |
| | | // 场景码,与前端约定,最终是需要前端解析 |
| | | body.put("scene", scene); |
| | | // 正式版为 "release",体验版为 "trial",开发版为 "develop"。默认是正式版。 |
| | | String env_version = "develop"; |
| | | String env_version = "trial"; |
| | | body.put("env_version", env_version); |
| | | if(isUsePage){ |
| | | body.put("page", page); |
| | |
| | | * accessSecret 自己的用户accessSecret |
| | | */ |
| | | DefaultProfile profile = DefaultProfile.getProfile( |
| | | "cn-hangzhou", "LTAI5tP56bE38bWvqqfSRkCQ", "lXcIyDrc9K01x3FjSgZqcKlrHwsE8b"); |
| | | "cn-hangzhou", "LTAI5tDuA9DXBJvVfJfMb19L", "IUsWIhUXd9pEgTNEkz1b3POI3javKN"); |
| | | IAcsClient client = new DefaultAcsClient(profile); |
| | | // 构建请求: |
| | | CommonRequest request = new CommonRequest(); |
| | |
| | | // 手机号 |
| | | request.putQueryParameter("PhoneNumbers", phone); |
| | | // 短信签名 |
| | | request.putQueryParameter("SignName", "豆米科技"); |
| | | request.putQueryParameter("SignName", "合肥鼎元旋压科技"); |
| | | // 短信模版CODE |
| | | request.putQueryParameter("TemplateCode", "SMS_243960729"); |
| | | request.putQueryParameter("TemplateCode", "SMS_332555204"); |
| | | // 构建短信验证码 |
| | | request.putQueryParameter("TemplateParam", JSONObject.toJSONString(codeMap)); |
| | | try { |
| | |
| | | * @param goodsId |
| | | * @return |
| | | */ |
| | | @Select(" select s.* , g.IMGURL as goodsImgUrl from goods_sku s left join goods g on s.GOODS_ID = g.id where s.isdeleted = 0 and s.goods_Id = #{goodsId} ") |
| | | @Select(" select s.* , s.stock as stockStr , g.IMGURL as goodsImgUrl from goods_sku s left join goods g on s.GOODS_ID = g.id where s.isdeleted = 0 and s.goods_Id = #{goodsId} ") |
| | | List<GoodsSkuResponse> getSkuResponseList(@Param("goodsId") Integer goodsId); |
| | | |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.doumee.dao.business.model.Integral; |
| | | import com.github.yulichang.base.mapper.MPJJoinMapper; |
| | | |
| | | /** |
| | | * @author 江蹄蹄 |
| | | * @date 2023/03/21 15:48 |
| | | */ |
| | | public interface IntegralMapper extends BaseMapper<Integral> { |
| | | public interface IntegralMapper extends MPJJoinMapper<Integral> { |
| | | |
| | | } |
| | |
| | | @TableField(exist = false) |
| | | private String activityImgurl; |
| | | |
| | | @ApiModelProperty(value = "分类颜色") |
| | | @TableField(exist = false) |
| | | private String param; |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | @ApiModelProperty(value = "退款备注", example = "1") |
| | | private Integer refundInfo; |
| | | |
| | | @ApiModelProperty(value = "退款配置信息", example = "1") |
| | | private String refundConfigInfo; |
| | | |
| | | @ApiModelProperty(value = "文件地址") |
| | | @TableField(exist = false) |
| | | private String resourcePath; |
| | |
| | | */ |
| | | @Data |
| | | @ApiModel("数据权限配置") |
| | | @TableName("SYSTEM_DATA_PERMISSION") |
| | | @TableName("system_data_permission") |
| | | public class SystemDataPermission implements Serializable { |
| | | |
| | | @TableId(type = IdType.AUTO) |
| | |
| | | package com.doumee.dao.system.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.doumee.core.constants.OperaType; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | |
| | | */ |
| | | @Data |
| | | @ApiModel("部门") |
| | | @TableName("system_department") |
| | | public class SystemDepartment implements Serializable { |
| | | |
| | | @TableId(type = IdType.AUTO) |
| | |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | |
| | | */ |
| | | @Data |
| | | @ApiModel("部门用户") |
| | | @TableName("system_department_user") |
| | | public class SystemDepartmentUser implements Serializable { |
| | | |
| | | @TableId(type = IdType.AUTO) |
| | |
| | | package com.doumee.dao.system.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.doumee.core.constants.OperaType; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | |
| | | */ |
| | | @Data |
| | | @ApiModel("字典") |
| | | @TableName("system_dict") |
| | | public class SystemDict implements Serializable { |
| | | |
| | | @TableId(type = IdType.AUTO) |
| | |
| | | package com.doumee.dao.system.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.doumee.core.constants.OperaType; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | |
| | | */ |
| | | @Data |
| | | @ApiModel("字典数据") |
| | | @TableName("system_dict_data") |
| | | public class SystemDictData implements Serializable { |
| | | |
| | | @TableId(type = IdType.AUTO) |
| | |
| | | package com.doumee.dao.system.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.doumee.core.annotation.excel.ExcelColumn; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | |
| | | */ |
| | | @Data |
| | | @ApiModel("登录日志") |
| | | @TableName("system_login_log") |
| | | public class SystemLoginLog { |
| | | |
| | | @TableId(type = IdType.AUTO) |
| | |
| | | package com.doumee.dao.system.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.FieldStrategy; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.doumee.core.constants.OperaType; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | |
| | | */ |
| | | @Data |
| | | @ApiModel("系统菜单") |
| | | @TableName("system_menu") |
| | | public class SystemMenu implements Serializable { |
| | | |
| | | @TableId(type = IdType.AUTO) |
| | |
| | | package com.doumee.dao.system.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.doumee.core.constants.OperaType; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | |
| | | */ |
| | | @Data |
| | | @ApiModel("系统权限") |
| | | @TableName("system_permission") |
| | | public class SystemPermission implements Serializable { |
| | | |
| | | @TableId(type = IdType.AUTO) |
| | |
| | | package com.doumee.dao.system.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.FieldStrategy; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.doumee.core.constants.OperaType; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | |
| | | */ |
| | | @Data |
| | | @ApiModel("岗位") |
| | | @TableName("system_position") |
| | | public class SystemPosition implements Serializable { |
| | | |
| | | @TableId(type = IdType.AUTO) |
| | |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | |
| | | */ |
| | | @Data |
| | | @ApiModel("岗位用户") |
| | | @TableName("system_position_user") |
| | | public class SystemPositionUser implements Serializable { |
| | | |
| | | @TableId(type = IdType.AUTO) |
| | |
| | | package com.doumee.dao.system.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.doumee.core.constants.OperaType; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | |
| | | */ |
| | | @Data |
| | | @ApiModel("系统角色") |
| | | @TableName("`system_role`") |
| | | public class SystemRole implements Serializable { |
| | | |
| | | @TableId(type = IdType.AUTO) |
| | |
| | | package com.doumee.dao.system.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | |
| | | */ |
| | | @Data |
| | | @ApiModel("角色菜单关联") |
| | | @TableName("system_role_menu") |
| | | public class SystemRoleMenu implements Serializable { |
| | | |
| | | @ApiModelProperty(value = "主键", example = "1") |
| | |
| | | package com.doumee.dao.system.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | |
| | | */ |
| | | @Data |
| | | @ApiModel("角色权限关联") |
| | | @TableName("system_role_permission") |
| | | public class SystemRolePermission implements Serializable { |
| | | |
| | | @ApiModelProperty(value = "主键", example = "1") |
| | |
| | | package com.doumee.dao.system.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.doumee.core.annotation.excel.ExcelColumn; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | |
| | | */ |
| | | @Data |
| | | @ApiModel("跟踪日志") |
| | | @TableName("system_trace_log") |
| | | public class SystemTraceLog implements Serializable { |
| | | |
| | | @TableId(type = IdType.AUTO) |
| | |
| | | */ |
| | | @Data |
| | | @ApiModel("系统用户") |
| | | @TableName("`SYSTEM_USER`") |
| | | @TableName("`system_user`") |
| | | public class SystemUser implements Serializable { |
| | | |
| | | @TableId(type = IdType.AUTO) |
| | |
| | | package com.doumee.dao.system.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | |
| | | */ |
| | | @Data |
| | | @ApiModel("用户角色关联") |
| | | @TableName("`system_user_role`") |
| | | public class SystemUserRole implements Serializable { |
| | | |
| | | @ApiModelProperty(value = "主键", example = "1") |
| | |
| | | package com.doumee.dao.web.dto.activity; |
| | | |
| | | import com.doumee.core.annotation.excel.ExcelColumn; |
| | | import com.doumee.dao.business.model.Multifile; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date createDate; |
| | | |
| | | @ApiModelProperty(value = "是否删除0否 1是", example = "1") |
| | | private Integer isdeleted; |
| | | |
| | | @ApiModelProperty(value = "用户编码(关联member表)", example = "1") |
| | | private Integer memberId; |
| | | |
| | |
| | | @ApiModelProperty(value = "主键", example = "1") |
| | | private Integer id; |
| | | |
| | | @ApiModelProperty(value = "是否删除0否 1是", example = "1") |
| | | private Integer isdeleted; |
| | | |
| | | @ApiModelProperty(value = "用户编码(关联member表)", example = "1") |
| | | private Integer memberId; |
| | | |
| | | @ApiModelProperty(value = "用户昵称" ) |
| | | @ApiModelProperty(value = "发布用户昵称" ) |
| | | private String nikeName; |
| | | |
| | | @ApiModelProperty(value = "用户昵称" ) |
| | | @ApiModelProperty(value = "用户头像" ) |
| | | private String memberImgUrl; |
| | | |
| | | @ApiModelProperty(value = "对象编码(关联activity表)", example = "1") |
| | |
| | | @ApiModelProperty(value = "是否扣除返还经销商积分:0=否;1=是") |
| | | private Integer returnShopIntegralStatus; |
| | | |
| | | @ApiModelProperty(value = "是否扣除返还用户积分:0=否;1=是") |
| | | @ApiModelProperty(value = "是否扣除已返还用户积分:0=否;1=是") |
| | | private Integer returnIntegralStatus; |
| | | |
| | | @ApiModelProperty(value = "是否扣除返还经销商结算金额:0=否;1=是") |
| | |
| | | @ApiModelProperty(value = "下标数据", example = "1") |
| | | private String indexData; |
| | | |
| | | @ApiModelProperty(value = "库存量Str", example = "1") |
| | | private String stockStr; |
| | | } |
| | |
| | | * |
| | | * @param id 主键 |
| | | */ |
| | | void deleteById(Integer id); |
| | | void deleteById(Integer id,Integer memberId); |
| | | |
| | | /** |
| | | * 删除 |
| | |
| | | package com.doumee.service.business.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.doumee.biz.system.SystemDictDataBiz; |
| | | import com.doumee.core.constants.ResponseStatus; |
| | | import com.doumee.core.exception.BusinessException; |
| | |
| | | aftersale.setReturnShopSettlement(BigDecimal.ZERO); |
| | | aftersale.setCode(getNextInCode()); |
| | | |
| | | //订单退回 扣除已结算 订单赠送积分 - 经销商 |
| | | if(Constants.equalsInteger(afterSaleApplyRequest.getReturnShopIntegralStatus(),Constants.ONE)){ |
| | | //订单退回返回给经销商的积分 |
| | | if(Objects.nonNull(goodsorder.getDistributionShopId())){ |
| | | Shop shop = shopMapper.selectById(goodsorder.getDistributionShopId()); |
| | | //经销商存在剩余积分 |
| | | if(Objects.nonNull(shop)&&shop.getIntegral().compareTo(BigDecimal.ZERO)>Constants.ZERO){ |
| | | //开启了扣除返还经销商积分 |
| | | if(Constants.equalsInteger(afterSaleApplyRequest.getReturnShopIntegralStatus(),Constants.ONE)){ |
| | | //记录扣除经销商积分值 |
| | | aftersale.setReturnShopIntegral(shop.getIntegral().compareTo(goodsorder.getReturnCustomerIntegral())>Constants.ZERO |
| | | ?goodsorder.getReturnCustomerIntegral():shop.getIntegral()); |
| | |
| | | } |
| | | } |
| | | |
| | | //订单退回 经销商结算余额 |
| | | //订单退回 扣除已结算 结算余额 - 经销商 |
| | | if(Constants.equalsInteger(afterSaleApplyRequest.getReturnShopSettlementStatus(),Constants.ONE)){ |
| | | if(Objects.nonNull(goodsorder.getDistributionShopId())){ |
| | | Shop shop = shopMapper.selectById(goodsorder.getDistributionShopId()); |
| | | //经销商存在剩余积分 |
| | | if(Objects.nonNull(shop)&&shop.getAmount().compareTo(BigDecimal.ZERO)>Constants.ZERO){ |
| | | //开启了扣除返还经销商积分 |
| | | if(Constants.equalsInteger(afterSaleApplyRequest.getReturnShopSettlementStatus(),Constants.ONE)){ |
| | | //查询订单明细经销商结算金额 |
| | | List<GoodsorderDetail> list = goodsorderDetailMapper.selectList(new QueryWrapper<GoodsorderDetail>().lambda() |
| | | .eq(GoodsorderDetail::getIsdeleted,Constants.ZERO) |
| | | .eq(GoodsorderDetail::getOrderId,goodsorder.getId()) |
| | | .isNotNull(GoodsorderDetail::getShopSettlement) |
| | | ); |
| | | //经销商存在剩余余额 |
| | | if(Objects.nonNull(shop)&&shop.getAmount().compareTo(BigDecimal.ZERO)>Constants.ZERO&&list.size()>Constants.ZERO){ |
| | | BigDecimal total = list.stream().map(i->i.getShopSettlement()).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | //记录扣除经销商积分值 |
| | | aftersale.setReturnShopSettlement(shop.getAmount().compareTo(goodsorder.getShopSettlement())>Constants.ZERO |
| | | ?goodsorder.getShopSettlement():shop.getAmount()); |
| | | aftersale.setReturnShopSettlement(shop.getAmount().compareTo(total)>Constants.ZERO |
| | | ?total:shop.getAmount()); |
| | | DealIntegralRequest dealIntegralRequest = new DealIntegralRequest(); |
| | | dealIntegralRequest.setIntegralNum(aftersale.getReturnShopIntegral()); |
| | | dealIntegralRequest.setIntegralNum(aftersale.getReturnShopSettlement()); |
| | | dealIntegralRequest.setDealType(Constants.ONE); |
| | | dealIntegralRequest.setMemberId(goodsorder.getDistributionShopId()); |
| | | dealIntegralRequest.setObjId(goodsorder.getId()); |
| | | dealIntegralRequest.setOrderCode(goodsorder.getCode().toString()); |
| | | dealIntegralRequest.setIntegralObjType(Constants.IntegralObjType.SHOP_ORDER_REFUND_CASH); |
| | | dealIntegralRequest.setParam1(goodsorder.getCode().toString()); |
| | | integralService.dealShopAmount(dealIntegralRequest); |
| | | |
| | | } |
| | | } |
| | | } |
| | | |
| | | //订单退回 返还给客户的积分 |
| | | if(Objects.nonNull(goodsorder.getDistributionShopId())){ |
| | | //扣除已返还用户积分 - 用户 |
| | | if(Constants.equalsInteger(afterSaleApplyRequest.getReturnIntegralStatus(),Constants.ONE)){ |
| | | Member member = memberMapper.selectById(goodsorder.getMemberId()); |
| | | //客户存在剩余积分 |
| | | if(Objects.nonNull(member)&&member.getIntegral().compareTo(BigDecimal.ZERO)>Constants.ZERO){ |
| | | //开启了扣除返还客户积分 |
| | | if(Constants.equalsInteger(afterSaleApplyRequest.getReturnIntegralStatus(),Constants.ONE)){ |
| | | //记录扣除经销商积分值 |
| | | aftersale.setReturnIntegral(member.getIntegral().compareTo(goodsorder.getReturnCustomerIntegral())>Constants.ZERO |
| | | ?goodsorder.getReturnCustomerIntegral():member.getIntegral()); |
| | | DealIntegralRequest dealIntegralRequest = new DealIntegralRequest(); |
| | | dealIntegralRequest.setIntegralNum(aftersale.getReturnShopIntegral()); |
| | | dealIntegralRequest.setIntegralNum(aftersale.getReturnIntegral()); |
| | | dealIntegralRequest.setDealType(Constants.ONE); |
| | | dealIntegralRequest.setMemberId(member.getId()); |
| | | dealIntegralRequest.setObjId(goodsorder.getId()); |
| | |
| | | integralService.dealIntegral(dealIntegralRequest,null); |
| | | } |
| | | } |
| | | } |
| | | |
| | | //订单退款 返还客户使用的积分 |
| | | if(Constants.equalsInteger(afterSaleApplyRequest.getReturnIntegralStatus(),Constants.ONE) |
| | | if(Constants.equalsInteger(afterSaleApplyRequest.getReturnUseIntegralStatus(),Constants.ONE) |
| | | && goodsorder.getUseIntegral().compareTo(BigDecimal.ZERO)>Constants.ZERO){ |
| | | DealIntegralRequest dealIntegralRequest = new DealIntegralRequest(); |
| | | dealIntegralRequest.setIntegralNum(aftersale.getReturnShopIntegral()); |
| | | dealIntegralRequest.setIntegralNum(goodsorder.getUseIntegral()); |
| | | dealIntegralRequest.setDealType(Constants.ZERO); |
| | | dealIntegralRequest.setMemberId(goodsorder.getMemberId()); |
| | | dealIntegralRequest.setObjId(goodsorder.getId()); |
| | |
| | | .set(Goodsorder::getRefundMoney, afterSaleApplyRequest.getMoney()) |
| | | .set(Goodsorder::getRefundUserId, loginUserInfo.getId()) |
| | | .set(Goodsorder::getRefundInfo, afterSaleApplyRequest.getRemark()) |
| | | .set(Goodsorder::getRefundConfigInfo, JSONObject.toJSONString(afterSaleApplyRequest)) |
| | | .eq(Goodsorder::getId, goodsorder.getId()) |
| | | ); |
| | | |
| | |
| | | .selectAs(Goods::getName,Collect::getName) |
| | | .selectAs(Goods::getPrice,Collect::getPrice) |
| | | .selectAs(Goods::getImgurl,Collect::getActivityImgurl) |
| | | .select(" ifnull(( select min(gs.PRICE) from goods_sku gs where gs.GOODS_ID = t1.id ),0) ", Collect::getLinePrice) |
| | | .select(" ifnull(( select min(gs.PRICE) from goods_sku gs where gs.GOODS_ID = t1.id and gs.ISDELETED = 0 ),0) ",Goods::getMinPrice) |
| | | .select(" ifnull(( select min(gs.SHOW_PRICE) from goods_sku gs where gs.GOODS_ID = t1.id and gs.ISDELETED = 0 ),0) ",Goods::getLinePrice) |
| | | .leftJoin(Goods.class,Goods::getId,Collect::getObjId) |
| | | .eq(Collect::getIsdeleted,Constants.ZERO) |
| | | .eq(Collect::getMemberId,memberId) |
| | |
| | | .selectAs(Activity::getCreateDate,Collect::getReleaseDate) |
| | | .selectAs(Activity::getLooknum,Collect::getReadNum) |
| | | .selectAs(Activity::getImgurl,Collect::getActivityImgurl) |
| | | .selectAs(Labels::getParam,Collect::getParam) |
| | | .selectAs(Labels::getName,Collect::getLabelName) |
| | | .selectAs(Activity::getContent,Collect::getContent) |
| | | .leftJoin(Activity.class,Activity::getId,Collect::getObjId) |
| | |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.core.utils.Constants; |
| | | import com.doumee.core.utils.Utils; |
| | | import com.doumee.dao.business.CommentJoinMapper; |
| | | import com.doumee.dao.business.CommentMapper; |
| | | import com.doumee.dao.business.MemberMapper; |
| | | import com.doumee.dao.business.MultifileMapper; |
| | | import com.doumee.dao.business.model.Activity; |
| | | import com.doumee.dao.business.model.Comment; |
| | | import com.doumee.dao.business.model.Member; |
| | | import com.doumee.dao.business.model.Multifile; |
| | | import com.doumee.dao.business.*; |
| | | import com.doumee.dao.business.model.*; |
| | | import com.doumee.dao.web.dto.CommentDTO; |
| | | import com.doumee.dao.web.dto.ZanDTO; |
| | | import com.doumee.dao.web.dto.activity.ActivityCommentDTO; |
| | |
| | | private MemberMapper memberMapper; |
| | | |
| | | @Autowired |
| | | private NoticeMapper noticeMapper; |
| | | |
| | | @Autowired |
| | | private ZanService zanService; |
| | | |
| | | @Autowired |
| | |
| | | ); |
| | | reply = Optional.ofNullable(reply).orElseThrow(() -> new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "回复目标不存在")); |
| | | target.setReplyId(reply.getId()); |
| | | target.setReplyMemberId(reply.getMemberId()); |
| | | target.setReplyMemberNikeName(reply.getReplyMemberNikeName()); |
| | | target.setCommentId(reply.getId()); |
| | | target.setCommentMemberId(reply.getMemberId()); |
| | | target.setCommentId(Objects.isNull(reply.getCommentId())?reply.getId():reply.getCommentId()); |
| | | target.setType(Constants.ONE); |
| | | target.setCommentId(reply.getCommentId()); |
| | | target.setCommentMemberId(reply.getCommentMemberId()); |
| | | target.setCommentMemberId(reply.getMemberId()); |
| | | |
| | | if(!Constants.equalsInteger(memberId,reply.getMemberId())){ |
| | | Member member = memberMapper.selectById(memberId); |
| | | //评论发送用户消息 |
| | | //发送核销通知 |
| | | Notice notice = Notice.getNotice( |
| | | Constants.NoticeType.COMMENT, |
| | | reply.getMemberId(), |
| | | reply.getActivityId() |
| | | ); |
| | | notice.setContent(notice.getContent().replace("{param}",member.getNickname())); |
| | | noticeMapper.insert(notice); |
| | | } |
| | | }else if (comment.getCommentId() != null ){ |
| | | Comment reply = commentMapper.selectById(comment.getCommentId()); |
| | | reply = Optional.ofNullable(reply).orElseThrow(() -> new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "一级评论目标不存在")); |
| | |
| | | |
| | | |
| | | @Override |
| | | public void deleteById(Integer id) { |
| | | commentMapper.deleteById(id); |
| | | public void deleteById(Integer id,Integer memberId) { |
| | | Comment comment = commentMapper.selectById(id); |
| | | if(Objects.isNull(comment)){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "评论不存在"); |
| | | } |
| | | if(!Constants.equalsInteger(memberId,comment.getMemberId())){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "非您的评论无权限删除"); |
| | | } |
| | | commentMapper.update(new UpdateWrapper<Comment>().lambda() |
| | | .set(Comment::getIsdeleted,Constants.ONE) |
| | | .eq(Comment::getId,id) |
| | | ); |
| | | } |
| | | |
| | | @Override |
| | |
| | | queryWrapper.eq(Comment::getType, Constants.ZERO); |
| | | queryWrapper.eq(Comment::getStatus, Constants.ZERO); |
| | | queryWrapper.eq(Comment::getActivityId,pageWrap.getModel().getActivityId()); |
| | | queryWrapper.orderByDesc(Comment::getId); |
| | | queryWrapper.orderByAsc(Comment::getId); |
| | | IPage<ActivityCommentDTO> result = commentJoinMapper.selectJoinPage(page, ActivityCommentDTO.class, queryWrapper); |
| | | |
| | | if (CollectionUtils.isEmpty(result.getRecords())){ |
| | |
| | | MPJLambdaWrapper<Comment> replyWrapper = new MPJLambdaWrapper<>(); |
| | | Utils.MP.blankToNull(pageWrap.getModel()); |
| | | replyWrapper.selectAs(Comment::getId,ActivityReplyCommentDTO::getId); |
| | | replyWrapper.selectAs(Comment::getReplyId,ActivityReplyCommentDTO::getReplyId); |
| | | if(Objects.isNull(pageWrap.getModel().getMemberId())){ |
| | | replyWrapper.select(" 0 ",ActivityReplyCommentDTO::getZanStatus); |
| | | }else{ |
| | |
| | | replyWrapper.selectAs(Member::getImgurl,ActivityReplyCommentDTO::getMemberImgUrl); |
| | | replyWrapper.selectCount(Comment::getId,ActivityReplyCommentDTO::getReplyCount); |
| | | replyWrapper.selectMin(Comment::getCreateDate,ActivityReplyCommentDTO::getCreateDate); |
| | | replyWrapper.select("reply.NICKNAME",ActivityReplyCommentDTO::getReplyMemberNikeName); |
| | | replyWrapper.leftJoin(Member.class,Member::getId,Comment::getMemberId); |
| | | replyWrapper.leftJoin("member reply on reply.id = t.REPLY_MEMBER_ID"); |
| | | replyWrapper.eq(Comment::getType, Constants.ONE); |
| | | replyWrapper.eq(Comment::getStatus, Constants.ZERO); |
| | | replyWrapper.in(Comment::getCommentId,commentIds); |
| | | replyWrapper.orderByDesc(Comment::getId); |
| | | replyWrapper.groupBy(Comment::getCommentId); |
| | | |
| | | List<ActivityReplyCommentDTO> activityCommentDTOS = commentJoinMapper.selectJoinList(ActivityReplyCommentDTO.class, replyWrapper); |
| | |
| | | } |
| | | } |
| | | result.getRecords().forEach(s->{ |
| | | s.setMemberImgUrl(StringUtils.isNotBlank(s.getMemberImgUrl())?memberFile+s.getMemberImgUrl():null); |
| | | if(Constants.equalsInteger(s.getIsdeleted(),Constants.ONE)){ |
| | | s.setContent("该评论已被原作者删除"); |
| | | }else{ |
| | | if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(multifileList)){ |
| | | s.setMultifileList(multifileList.stream().filter(t -> t.getObjId().equals(s.getId())).collect(Collectors.toList())); |
| | | } |
| | | } |
| | | s.setMemberImgUrl(StringUtils.isNotBlank(s.getMemberImgUrl())?memberFile+s.getMemberImgUrl():null); |
| | | ZanDTO object = MapUtils.getObject(count, s.getId()); |
| | | ActivityReplyCommentDTO replyCommentDTO = collect.get(s.getId()); |
| | | if(Objects.nonNull(replyCommentDTO)){ |
| | | ZanDTO replyZan = MapUtils.getObject(count, replyCommentDTO.getId()); |
| | | replyCommentDTO.setZanCount(replyZan != null ? replyZan.getCount() : 0); |
| | | if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(multifileList)){ |
| | | replyCommentDTO.setMultifileList(multifileList.stream().filter(t -> t.getObjId().equals(s.getId())).collect(Collectors.toList())); |
| | | replyCommentDTO.setMultifileList(multifileList.stream().filter(t -> t.getObjId().equals(replyCommentDTO.getId())).collect(Collectors.toList())); |
| | | } |
| | | replyCommentDTO.setMemberImgUrl(StringUtils.isNotBlank(replyCommentDTO.getMemberImgUrl())?memberFile+replyCommentDTO.getMemberImgUrl():null); |
| | | s.setActivityReplyCommentDTO(replyCommentDTO); |
| | |
| | | queryWrapper.select(" (select count(1) from zan z where z.OBJ_ID = t.id and z.ISDELETED = 0 and z.OBJ_TYPE = 0) ",ActivityReplyCommentDTO::getZanCount); |
| | | queryWrapper.select("reply.NICKNAME as replyMemberNikeName"); |
| | | queryWrapper.leftJoin(Member.class,Member::getId,Comment::getMemberId); |
| | | queryWrapper.leftJoin("member reply on reply.id = t.REPLY_MEMBER_ID"); |
| | | queryWrapper.leftJoin("member reply on reply.id = t.COMMENT_MEMBER_ID"); |
| | | queryWrapper.eq(Comment::getType, Constants.ONE); |
| | | queryWrapper.eq(Comment::getStatus, Constants.ZERO); |
| | | queryWrapper.eq(Comment::getCommentId,pageWrap.getModel().getCommentId()); |
| | | queryWrapper.orderByDesc(Comment::getId); |
| | | queryWrapper.orderByAsc(Comment::getId); |
| | | IPage<ActivityReplyCommentDTO> result = commentJoinMapper.selectJoinPage(page, ActivityReplyCommentDTO.class, queryWrapper); |
| | | if (CollectionUtils.isEmpty(result.getRecords())){ |
| | | return PageData.from(result); |
| | |
| | | } |
| | | } |
| | | List<Integer> integerStream = result.getRecords().stream().map(s -> s.getId()).collect(Collectors.toList()); |
| | | |
| | | Map<Integer, ZanDTO> count = zanService.count(integerStream); |
| | | result.getRecords().forEach(s->{ |
| | | s.setMemberImgUrl(StringUtils.isNotBlank(s.getMemberImgUrl())?memberFile+s.getMemberImgUrl():null); |
| | | if(Constants.equalsInteger(s.getIsdeleted(),Constants.ONE)){ |
| | | s.setContent("该评论已被原作者删除"); |
| | | }else{ |
| | | if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(multifileList)){ |
| | | s.setMultifileList(multifileList.stream().filter(t -> t.getObjId().equals(s.getId())).collect(Collectors.toList())); |
| | | } |
| | | } |
| | | s.setMemberImgUrl(StringUtils.isNotBlank(s.getMemberImgUrl())?memberFile+s.getMemberImgUrl():null); |
| | | ZanDTO replyZan = MapUtils.getObject(count, s.getId()); |
| | | s.setZanCount(replyZan != null ? replyZan.getCount() : 0); |
| | | if (pageWrap.getModel().getCommentId().equals(s.getReplyId())){ |
| | |
| | | queryWrapper.eq(pageWrap.getModel().getBrandId() != null, Goods::getBrandId, pageWrap.getModel().getBrandId()); |
| | | queryWrapper.eq(pageWrap.getModel().getStatus() != null, Goods::getStatus, pageWrap.getModel().getStatus()); |
| | | queryWrapper.in(pageWrap.getModel().getIdList() != null && pageWrap.getModel().getIdList().size()>0, Goods::getId, pageWrap.getModel().getIdList()); |
| | | if(pageWrap.getModel().getShopId() !=null){ |
| | | queryWrapper.orderByAsc("shopPrice"); |
| | | } |
| | | // if(pageWrap.getModel().getShopId() !=null){ |
| | | // queryWrapper.orderByAsc("shopPrice"); |
| | | // } |
| | | queryWrapper.orderByDesc(Goods::getId); |
| | | IPage<Goods> result = goodsAdminJoinMapper.selectJoinPage(page, Goods.class, queryWrapper); |
| | | initResult(result.getRecords(),pageWrap.getModel().getShopId()==null); |
| | |
| | | GoodsRequest model = pageWrap.getModel(); |
| | | MPJLambdaWrapper<Goods> wrapper = new MPJLambdaWrapper<Goods>() |
| | | .selectAll(Goods.class) |
| | | .select(" ifnull(( select min(gs.PRICE) from goods_sku gs where gs.GOODS_ID = t.id ),0) ",Goods::getMinPrice) |
| | | .select(" ifnull(( select min(gs.SHOW_PRICE) from goods_sku gs where gs.GOODS_ID = t.id ),0) ",Goods::getLinePrice) |
| | | .select(" ifnull(( select min(gs.PRICE) from goods_sku gs where gs.GOODS_ID = t.id and gs.ISDELETED = 0 ),0) ",Goods::getMinPrice) |
| | | .select(" ifnull(( select min(gs.SHOW_PRICE) from goods_sku gs where gs.GOODS_ID = t.id and gs.ISDELETED = 0 ),0) ",Goods::getLinePrice) |
| | | .leftJoin(SystemUser.class, SystemUser::getId, Goods::getCreator) |
| | | .eq(Goods::getIsdeleted,Constants.ZERO) |
| | | .eq(!Objects.isNull(model) && Objects.nonNull(model.getCategoryId()), |
| | |
| | | .like(StringUtils.isNotBlank(model.getGoodsName()),Goods::getName,model.getGoodsName()); |
| | | if(Objects.nonNull(model.getShopId())){ |
| | | wrapper.select(" ifnull( ( select sgr.PRICE from shop_goods_relation sgr where sgr.GOODS_ID = t.ID and sgr.ISDELETED = 0 and sgr.`STATUS` = 0 and sgr.SHOP_ID = "+model.getShopId()+" ) ,0) ",Goods::getExFactoryPrice); |
| | | wrapper.select(" ifnull(( select sum(gd.GOODS_NUM) from goodsorder_detail gd inner join goodsorder go on gd.ORDER_ID = go.id where gd.GOODS_ID = t.`id` and go.DISTRIBUTION_SHOP_ID = "+model.getShopId()+" ),0) ",Goods::getRealSaleNum); |
| | | wrapper.select(" ifnull(( select sum(gd.GOODS_NUM) from goodsorder_detail gd inner join goodsorder go on gd.ORDER_ID = go.id where go.PAY_STATUS = 1 and gd.GOODS_ID = t.`id` and go.DISTRIBUTION_SHOP_ID = "+model.getShopId()+" ),0) ",Goods::getRealSaleNum); |
| | | |
| | | }else{ |
| | | wrapper.select(" (( select ifnull(sum(GOODS_NUM),0) from goodsorder_detail gd where gd.GOODS_ID = t.id )) ",Goods::getRealSaleNum); |
| | | wrapper.select(" ifnull(( select sum(gd.GOODS_NUM) from goodsorder_detail gd inner join goodsorder go on gd.ORDER_ID = go.id where go.PAY_STATUS = 1 and gd.GOODS_ID = t.`id` ),0) ",Goods::getRealSaleNum); |
| | | } |
| | | |
| | | if(Objects.nonNull(model.getSortInfo())){ |
| | |
| | | if(Constants.equalsInteger(model.getSortInfo(),Constants.ZERO)){ |
| | | wrapper.orderByDesc("t.CREATE_DATE"); |
| | | }else if(Constants.equalsInteger(model.getSortInfo(),Constants.ONE)){ |
| | | wrapper.orderByAsc("(realSaleNum + t.SALENUM)"); |
| | | wrapper.orderByAsc("(realSaleNum + ifnull(t.SALENUM,0))"); |
| | | }else if(Constants.equalsInteger(model.getSortInfo(),Constants.TWO)){ |
| | | wrapper.orderByAsc("minPrice"); |
| | | }else if(Constants.equalsInteger(model.getSortInfo(),Constants.THREE)){ |
| | | wrapper.orderByDesc("(realSaleNum + t.SALENUM)"); |
| | | wrapper.orderByDesc("(realSaleNum + ifnull(t.SALENUM,0))"); |
| | | }else if(Constants.equalsInteger(model.getSortInfo(),Constants.FOUR)){ |
| | | wrapper.orderByDesc("minPrice"); |
| | | } |
| | |
| | | |
| | | List<GoodsSkuResponse> goodsSkuResponseList = goodsSkuMapper.getSkuResponseList(goodsResponse.getId()); |
| | | Integer sumStock = Constants.ZERO; |
| | | Boolean noRestrictions = true; |
| | | for (GoodsSkuResponse goodsSkuResponse:goodsSkuResponseList) { |
| | | goodsSkuResponse.setStock(Objects.isNull(goodsSkuResponse.getStock())?Constants.ZERO:goodsSkuResponse.getStock()); |
| | | sumStock = sumStock + goodsSkuResponse.getStock(); |
| | | if(StringUtils.isNotBlank(goodsSkuResponse.getStockStr())){ |
| | | noRestrictions = false; |
| | | } |
| | | } |
| | | //真实销量 = realSaleNum - saleNum; |
| | | //真实库存= sumStock - (realSaleNum - saleNum) |
| | | if(noRestrictions){ |
| | | goodsResponse.setStock(-Constants.ONE); |
| | | }else{ |
| | | goodsResponse.setStock(sumStock); |
| | | } |
| | | goodsResponse.setGoodsSkuResponseList(goodsSkuResponseList); |
| | | //Sku基础信息 |
| | | List<SkuResponse> skuResponseList = skuMapper.getSkuResponseList(goodsResponse.getId()); |
| | |
| | | Goods goodsResponse = goodsMapper.selectOne( |
| | | new MPJLambdaWrapper<Goods>() |
| | | .selectAll(Goods.class) |
| | | .select(" (( select ifnull(sum(GOODS_NUM),0) from goodsorder_detail gd where gd.GOODS_ID = t.id )) ",Goods::getRealSaleNum) |
| | | .select(" ifnull(( select min(gs.PRICE) from goods_sku gs where gs.GOODS_ID = t.id ),0) ",Goods::getMinPrice) |
| | | .select(" ifnull(( select min(gs.SHOW_PRICE) from goods_sku gs where gs.GOODS_ID = t.id ),0) ",Goods::getLinePrice) |
| | | .select(" ifnull(( select sum(gd.GOODS_NUM) from goodsorder_detail gd inner join goodsorder go on gd.ORDER_ID = go.id where go.PAY_STATUS = 1 and gd.GOODS_ID = t.`id` ),0) ",Goods::getRealSaleNum) |
| | | .select(" ifnull(( select min(gs.PRICE) from goods_sku gs where gs.GOODS_ID = t.id and gs.ISDELETED = 0),0) ",Goods::getMinPrice) |
| | | .select(" ifnull(( select min(gs.SHOW_PRICE) from goods_sku gs where gs.GOODS_ID = t.id and gs.ISDELETED = 0),0) ",Goods::getLinePrice) |
| | | .leftJoin(SystemUser.class, SystemUser::getId, Goods::getCreator) |
| | | // .eq(Goods::getIsdeleted,Constants.ZERO) |
| | | // .eq(Goods::getStatus, Constants.ZERO) |
| | |
| | | Constants.UserActionType.CHANGE_ORDER_KD, |
| | | userActionMapper, |
| | | update.getEditDate(), |
| | | new String[]{goodsorder.getKdInfo()}, |
| | | StringUtils.isNotBlank(goodsorder.getKdInfo())?new String[]{query.getKdInfo()}:null, |
| | | JSONObject.toJSONString(update) , |
| | | query.getKdName()+"(单号:"+query.getKdCode()+")", |
| | | goodsorder.getKdName()+"(单号:"+goodsorder.getKdCode()+")"); |
| | |
| | | //发送发货站内信 |
| | | Notice notice = Notice.getNotice( |
| | | Constants.NoticeType.NOTICE_ORDER_SEND, |
| | | goodsorder.getMemberId(), |
| | | query.getMemberId(), |
| | | goodsorder.getId() |
| | | ); |
| | | notice.setContent(notice.getContent().replace("{param}",goodsorder.getCode().toString())); |
| | |
| | | if(Objects.isNull(member.getBindShopId())){ |
| | | memberMapper.update(new UpdateWrapper<Member>().lambda() |
| | | .set(Member::getBindShopId,shop.getId()) |
| | | .set(Member::getBindShopDate,new Date()) |
| | | .eq(Member::getId,member.getId()) |
| | | ); |
| | | } |
| | | goodsorder.setPickUpShopId(shop.getId()); |
| | | goodsorder.setDistributionShopId(shop.getId()); |
| | | goodsorder.setLinkname(member.getName()); |
| | | goodsorder.setLinkname(StringUtils.isNotBlank(member.getName())?member.getName():member.getNickname()); |
| | | goodsorder.setLinkphone(member.getPhone()); |
| | | if(Objects.isNull(member.getBindShopId())){ |
| | | member.setBindShopId(shop.getId()); |
| | |
| | | .eq(MemberCoupon::getId,orderPayConfirmResponse.getMemberCoupon().getId()) |
| | | ); |
| | | } |
| | | goodsorder.setReturnCustomerIntegral(getBackIntegral(goodsorder.getPrice(),Constants.ONE)); |
| | | goodsorder.setReturnMemberIntegral(getBackIntegral(goodsorder.getPrice(),Constants.ZERO)); |
| | | goodsorder.setReturnCustomerIntegral(getBackIntegral(goodsorder.getPrice().subtract(goodsorder.getMailPrice()),Constants.ONE)); |
| | | goodsorder.setReturnMemberIntegral(getBackIntegral(goodsorder.getPrice().subtract(goodsorder.getMailPrice()),Constants.ZERO)); |
| | | goodsorderMapper.insert(goodsorder); |
| | | List<OrderGoodsCalculateResponse> goodsCalculateList = orderPayConfirmResponse.getGoodsCalculateList(); |
| | | if(CollectionUtils.isEmpty(goodsCalculateList)){ |
| | |
| | | } |
| | | List<GoodsorderDetail> goodsOrderDetailList = new ArrayList<>(); |
| | | BigDecimal shopSettlement = BigDecimal.ZERO; |
| | | for (OrderGoodsCalculateResponse payDetailRequest:goodsCalculateList) { |
| | | for (int i = 0; i < goodsCalculateList.size(); i++) { |
| | | OrderGoodsCalculateResponse payDetailRequest = goodsCalculateList.get(i); |
| | | //查询商品 |
| | | GoodsSku goodsSku = goodsSkuMapper.selectById(payDetailRequest.getSkuId()); |
| | | if(Objects.isNull(goodsSku)||!Constants.equalsInteger(goodsSku.getIsdeleted(),Constants.ZERO)){ |
| | |
| | | //经销商优惠承担占比 |
| | | BigDecimal shopRate = new BigDecimal("100").subtract(platformConfigDTO.getTotalRate()); |
| | | //计算经销商优惠承担金额 (优惠券抵扣金额 + 积分抵扣金额) * 占比比例 |
| | | BigDecimal shopDeductAmount = payDetailRequest.getCouponDeductCash().add(payDetailRequest.getIntegralDeductCash()) |
| | | BigDecimal shopDeductAmount = payDetailRequest.getCouponDeductCash().add(Constants.equalsInteger(orderPayRequest.getUseIntegral(),Constants.ONE)?payDetailRequest.getIntegralDeductCash():BigDecimal.ZERO) |
| | | .multiply(shopRate).divide(new BigDecimal("100"),2, RoundingMode.HALF_UP); |
| | | //根据经销商销售模式 计算应结算金额 |
| | | if(shop.getSaleType().equals(Constants.ONE)){ |
| | | if(Constants.equalsInteger(shop.getSaleType(),Constants.ONE)&&Constants.equalsInteger(goodsorder.getReceiveType(),Constants.ONE)){ |
| | | goodsOrderDetail.setShopSettlement(goodsOrderDetail.getPrice().subtract(shopDeductAmount)); |
| | | }else { |
| | | //平台铺货 |
| | |
| | | |
| | | //存在现金支付 |
| | | if(Constants.equalsInteger(goodsorder.getPayMethod(),Constants.ZERO)){ |
| | | goodsorderMapper.update(null,new UpdateWrapper<Goodsorder>().lambda() |
| | | .set(Goodsorder::getShopSettlement,shopSettlement) |
| | | .eq(Goodsorder::getId,goodsorder.getId()) |
| | | ); |
| | | PayResponse payResponse = this.wxPay(goodsorder,member); |
| | | payResponse.setLockKey(lockKey); |
| | | return payResponse; |
| | |
| | | .set(Goodsorder::getShopSettlement,shopSettlement) |
| | | .set(Goodsorder::getPayStatus,Constants.OrderStatus.PAY_DONE.getKey()) |
| | | .set(Goodsorder::getPayDate,DateUtil.getCurrDateTime()) |
| | | .set(Goodsorder::getId,goodsorder.getId()) |
| | | .eq(Goodsorder::getId,goodsorder.getId()) |
| | | ); |
| | | PayResponse payResponse = new PayResponse(); |
| | | payResponse.setOrderId(goodsorder.getId()); |
| | |
| | | Goods goods = goodsMapper.selectById(goodsSku.getGoodsId()); |
| | | goodsName = goods.getName(); |
| | | } |
| | | if(!Objects.isNull(goodsSku)){ |
| | | if(!Objects.isNull(goodsSku)&&Objects.nonNull(goodsSku.getStock())){ |
| | | goodsSku.setStock(goodsSku.getStock().add(new BigDecimal(Constants.formatIntegerNum(goodsorderDetail.getGoodsNum())))); |
| | | goodsSkuMapper.updateById(goodsSku); |
| | | } |
| | |
| | | amount = amount.add(response.getSkuAmount()); |
| | | } |
| | | } |
| | | MemberCoupon memberCoupon = new MemberCoupon(); |
| | | MemberCoupon memberCoupon = null; |
| | | orderPayConfirmResponse.setCouponAmount(couponAmount); |
| | | //获取可以使用的优惠券 |
| | | List<MemberCoupon> memberCouponList = memberCouponService.getApplyCoupon(request.getPayDetailRequestList(),request.getMemberId()); |
| | |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"无可用优惠券,请刷新查看"); |
| | | } |
| | | } |
| | | if(Objects.nonNull(memberCoupon)){ |
| | | //计算优惠券占比 |
| | | memberCouponService.calculateCouponRata(memberCoupon,goodsCalculateList,amount); |
| | | } |
| | | |
| | | //查询用户总积分 |
| | | Member member = memberMapper.selectById(request.getMemberId()); |
| | | //最低可用启用积分 |
| | |
| | | orderPayConfirmResponse.setDeductIntegral(deductIntegral); |
| | | orderPayConfirmResponse.setIntegralAmount(integralAmount); |
| | | if(Constants.equalsInteger(orderPayConfirmResponse.getIntegralStatus(),Constants.ZERO)){ |
| | | //计算积分占比 |
| | | integralAmount = this.calculateIntegralRata(orderPayConfirmResponse,goodsCalculateList,member.getIntegral()); |
| | | }else{ |
| | | orderPayConfirmResponse.setSurplusIntegral(member.getIntegral()); |
| | |
| | | if(Constants.equalsInteger(type,Constants.ZERO)){ |
| | | if( Constants.equalsInteger(platformConfigDTO.getReturnMemberIntegralStatus(),Constants.ZERO) |
| | | && Objects.nonNull(platformConfigDTO.getReturnMemberIntegral())){ |
| | | integralBack = payAmount.multiply(platformConfigDTO.getReturnMemberIntegral()).divide(BigDecimal.ONE,0,BigDecimal.ROUND_DOWN); |
| | | integralBack = payAmount.divide(platformConfigDTO.getReturnMemberIntegral(),2,BigDecimal.ROUND_DOWN); |
| | | } |
| | | }else{ |
| | | if( Constants.equalsInteger(platformConfigDTO.getReturnShopIntegralStatus(),Constants.ZERO) |
| | | && Objects.nonNull(platformConfigDTO.getReturnShopIntegral())){ |
| | | integralBack = payAmount.multiply(platformConfigDTO.getReturnShopIntegral()).divide(BigDecimal.ONE,0,BigDecimal.ROUND_DOWN); |
| | | integralBack = payAmount.divide(platformConfigDTO.getReturnShopIntegral(),2,BigDecimal.ROUND_DOWN); |
| | | } |
| | | } |
| | | return integralBack; |
| | |
| | | .multiply(i.getDeductRata()).divide(new BigDecimal("100"),2,RoundingMode.DOWN)).reduce(BigDecimal.ZERO,BigDecimal::add); |
| | | //积分-现金兑换比例(XXX积分抵扣1元) |
| | | BigDecimal cashToIntegralRata = new BigDecimal(systemDictDataBiz.queryByCode(Constants.INTEGRAL_SET,Constants.INTERALSET_DEDUCTINTEGRALLIMIT).getCode()); |
| | | //积分最大可抵扣金额 |
| | | BigDecimal deductionCash = totalIntegral.divide(cashToIntegralRata,2,RoundingMode.DOWN); |
| | | BigDecimal surDeductionCash = deductionCash; |
| | | BigDecimal goodUseIntegral = BigDecimal.ZERO; |
| | | BigDecimal surUseIntegral = totalIntegral; |
| | | |
| | | //当前选择商品抵扣需要使用的积分 |
| | | BigDecimal maxDeductionIntegral = maxDeductionCash.multiply(cashToIntegralRata); |
| | | //获取当前需要支付的现金总额 |
| | |
| | | BigDecimal realDeductionCash = BigDecimal.ZERO; |
| | | for (int j = 0; j < goodsCalculateList.size(); j++) { |
| | | //获取最大可抵扣金额 |
| | | BigDecimal deductionCash = goodsCalculateList.get(j).getSkuAmount().subtract(goodsCalculateList.get(j).getCouponDeductCash()) |
| | | BigDecimal goodDeductionCash = goodsCalculateList.get(j).getSkuAmount().subtract(goodsCalculateList.get(j).getCouponDeductCash()) |
| | | .multiply(goodsCalculateList.get(j).getDeductRata()).divide(new BigDecimal("100"),2,RoundingMode.DOWN); |
| | | goodsCalculateList.get(j).setIntegralMaxDeductCash(deductionCash); |
| | | goodsCalculateList.get(j).setIntegralMaxDeductCash(goodDeductionCash); |
| | | BigDecimal rata = goodDeductionCash.divide(maxDeductionCash,2,BigDecimal.ROUND_HALF_UP); |
| | | //如果剩余积分大于可以使用积分 则直接满额计算 反之 剩余积分不能满足全部抵扣 单独计算每个商品占比 |
| | | if(totalIntegral.compareTo(maxDeductionIntegral)<Constants.ZERO){ |
| | | deductionCash = deductionCash.divide(payCash).multiply(totalIntegral); |
| | | if(Constants.equalsInteger(j+1,goodsCalculateList.size())){ |
| | | goodDeductionCash = surDeductionCash; |
| | | goodUseIntegral = surUseIntegral; |
| | | }else{ |
| | | goodDeductionCash = (goodDeductionCash.multiply(deductionCash)).divide(maxDeductionCash,2,BigDecimal.ROUND_HALF_UP); |
| | | surDeductionCash = surDeductionCash.subtract(goodDeductionCash); |
| | | goodUseIntegral = (goodDeductionCash.multiply(totalIntegral)).divide(maxDeductionCash,2,BigDecimal.ROUND_HALF_UP); |
| | | surUseIntegral = totalIntegral.subtract(goodUseIntegral); |
| | | } |
| | | goodsCalculateList.get(j).setIntegralDeductCash(deductionCash); |
| | | realDeductionCash = realDeductionCash.add(deductionCash); |
| | | } |
| | | goodsCalculateList.get(j).setIntegralDeductCash(goodDeductionCash); |
| | | goodsCalculateList.get(j).setIntegralDeduct(goodUseIntegral); |
| | | realDeductionCash = realDeductionCash.add(goodDeductionCash); |
| | | |
| | | } |
| | | //剩余积分值 |
| | | orderPayConfirmResponse.setSurplusIntegral(totalIntegral); |
| | |
| | | if(Objects.isNull(coupon)||Constants.equalsInteger(coupon.getIsdeleted(),Constants.ONE)&&num>Constants.ZERO){ |
| | | continue; |
| | | } |
| | | if(coupon.getNum()>Constants.ZERO){ |
| | | //查询已领取数量 |
| | | Integer getNum = memberCouponMapper.selectCount(new QueryWrapper<MemberCoupon>().lambda() |
| | | .eq(MemberCoupon::getIsdeleted,Constants.ZERO) |
| | | .eq(MemberCoupon::getCouponId,couponId) |
| | | .ne(MemberCoupon::getGetMethod,Constants.TWO) |
| | | ).intValue(); |
| | | if(getNum >= coupon.getNum()){ |
| | | continue; |
| | | } |
| | | if(num>(coupon.getNum() - getNum)){ |
| | | num = coupon.getNum().intValue() - getNum; |
| | | } |
| | | } |
| | | MemberCoupon memberCoupon = MemberCoupon.couponToBean(coupon,inviteMember,new Date(),Constants.ONE,null); |
| | | |
| | | for (int i = 0; i < num; i++) { |
| | | //满减卷不会生成maxPrice 需要根据优惠券减少金额设置 |
| | | if(Constants.equalsInteger(coupon.getCouponType(),Constants.ZERO)){ |
| | |
| | | if(Objects.isNull(shop)){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"未查询到订单关联经销商信息,请联系管理员"); |
| | | } |
| | | // if(!Constants.equalsInteger(shop.getMemberId(),memberId)){ |
| | | // throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"["+shop.getName()+"]非您绑定的经销商,无法进行该操作!"); |
| | | // } |
| | | if(!Constants.equalsInteger(shop.getId(),memberId)){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"对不起,当前订单核销门店为["+shop.getName()+"],您无法进行该操作!"); |
| | | } |
| | | goodsorder.setStatus(Constants.OrderStatus.DONE.getKey()); |
| | | goodsorder.setDoneDate(new Date()); |
| | | goodsorderMapper.updateById(goodsorder); |
| | |
| | | if(Objects.isNull(goodsorder.getDistributionShopId()) || Constants.equalsInteger(goodsorder.getPayMethod(),Constants.ONE)){ |
| | | return; |
| | | } |
| | | BigDecimal backIntegral = getBackIntegral(goodsorder.getPrice(),Constants.ONE); |
| | | if (backIntegral.compareTo(BigDecimal.ZERO) > 0) { |
| | | if (goodsorder.getReturnCustomerIntegral().compareTo(BigDecimal.ZERO) > 0) { |
| | | //更新余额信息 添加积分变动记录 |
| | | DealIntegralRequest dealIntegralRequest = new DealIntegralRequest(); |
| | | dealIntegralRequest.setIntegralNum(backIntegral); |
| | | dealIntegralRequest.setIntegralNum(goodsorder.getReturnCustomerIntegral()); |
| | | dealIntegralRequest.setDealType(Constants.ZERO); |
| | | dealIntegralRequest.setMemberId(goodsorder.getDistributionShopId()); |
| | | dealIntegralRequest.setObjId(goodsorder.getId()); |
| | |
| | | if(Constants.equalsInteger(goodsorder.getPayMethod(),Constants.ONE)){ |
| | | return; |
| | | } |
| | | BigDecimal backIntegral = getBackIntegral(goodsorder.getPrice(),Constants.ZERO); |
| | | if (backIntegral.compareTo(BigDecimal.ZERO) > 0) { |
| | | if (goodsorder.getReturnMemberIntegral().compareTo(BigDecimal.ZERO) > 0) { |
| | | //更新余额信息 添加积分变动记录 |
| | | DealIntegralRequest dealIntegralRequest = new DealIntegralRequest(); |
| | | dealIntegralRequest.setIntegralNum(backIntegral); |
| | | dealIntegralRequest.setIntegralNum(goodsorder.getReturnMemberIntegral()); |
| | | dealIntegralRequest.setDealType(Constants.ZERO); |
| | | dealIntegralRequest.setMemberId(goodsorder.getMemberId()); |
| | | dealIntegralRequest.setObjId(goodsorder.getId()); |
| | |
| | | .eq(Notice::getIsdeleted,Constants.ZERO) |
| | | .eq(Notice::getMemberId,member.getId()) |
| | | .eq(Notice::getStatus,Constants.ZERO) |
| | | )>=Constants.ZERO?Constants.ZERO:Constants.ONE |
| | | )>Constants.ZERO?Constants.ZERO:Constants.ONE |
| | | ); |
| | | |
| | | return homeInfoResponse; |
| | |
| | | List<Goodsorder> goodsorderList = goodsorderMapper.selectList(new QueryWrapper<Goodsorder>().lambda() |
| | | .eq(Goodsorder::getIsdeleted, Constants.ZERO) |
| | | .eq(Goodsorder::getStatus, Constants.OrderStatus.WAIT_PAY.getKey()) |
| | | .apply(" CREATE_DATE > DATE_SUB(NOW(), INTERVAL 15 MINUTE) ") |
| | | .apply(" CREATE_DATE < DATE_SUB(NOW(), INTERVAL 15 MINUTE) ") |
| | | ); |
| | | if(CollectionUtils.isNotEmpty(goodsorderList)){ |
| | | for (Goodsorder goodsorder:goodsorderList) { |
| | |
| | | private GoodsorderMapper goodsorderMapper; |
| | | |
| | | @Autowired |
| | | private GoodsorderDetailMapper goodsorderDetailMapper; |
| | | |
| | | @Autowired |
| | | private NoticeService noticeService; |
| | | |
| | | @Autowired |
| | |
| | | integral.setIsdeleted(Constants.ZERO); |
| | | integral.setTitle(dealIntegralRequest.getIntegralObjType().getName()); |
| | | String info = dealIntegralRequest.getIntegralObjType().getNoteinfo(); |
| | | info = info.replace("${param}",dealIntegralRequest.getIntegralNum().intValue()+""); |
| | | info = info.replace("${param}",dealIntegralRequest.getIntegralNum()+""); |
| | | if(StringUtils.isNotBlank(dealIntegralRequest.getParam1())){ |
| | | info = info .replace("${param1}",dealIntegralRequest.getParam1()); |
| | | } |
| | |
| | | |
| | | //站内信 |
| | | noticeService.saveMemberIntegralNotice( |
| | | dealIntegralRequest.getIntegralObjType(),Constants.ONE,member.getId(),dealIntegralRequest.getIntegralNum(), |
| | | dealIntegralRequest.getIntegralObjType(),Constants.ZERO,member.getId(),dealIntegralRequest.getIntegralNum(), |
| | | integral.getId(), info |
| | | ); |
| | | return integral.getId(); |
| | |
| | | shopMapper.update(null,new UpdateWrapper<Shop>().lambda() |
| | | .eq(Shop::getId,shop.getId()) |
| | | .set(Shop::getEditDate,new Date()) |
| | | .setSql(dealIntegralRequest.getDealType().equals(Constants.ZERO),"total_integral = ifnull(total_integral,0)+" + dealIntegralRequest.getIntegralNum())//累计增加 |
| | | .setSql(dealIntegralRequest.getDealType().equals(Constants.ZERO),"integral = ifnull(integral,0)+" + dealIntegralRequest.getIntegralNum()) |
| | | .setSql(dealIntegralRequest.getDealType().equals(Constants.ONE),"integral = ifnull(integral,0)-" + dealIntegralRequest.getIntegralNum())); |
| | | .setSql(dealIntegralRequest.getDealType().equals(Constants.ZERO),"TOTAL_AMOUNT = ifnull(TOTAL_AMOUNT,0)+" + dealIntegralRequest.getIntegralNum())//累计增加 |
| | | .setSql(dealIntegralRequest.getDealType().equals(Constants.ZERO),"AMOUNT = ifnull(AMOUNT,0)+" + dealIntegralRequest.getIntegralNum()) |
| | | .setSql(dealIntegralRequest.getDealType().equals(Constants.ONE),"AMOUNT = ifnull(AMOUNT,0)-" + dealIntegralRequest.getIntegralNum())); |
| | | return integral.getId(); |
| | | } |
| | | |
| | |
| | | .reduce(BigDecimal.ZERO, BigDecimal::add) |
| | | ); |
| | | integralDataResponse.setWaitPayAmount( |
| | | goodsorderMapper.selectList(new QueryWrapper<Goodsorder>().lambda() |
| | | goodsorderDetailMapper.selectJoinList(GoodsorderDetail.class,new MPJLambdaWrapper<GoodsorderDetail>() |
| | | .selectAll(GoodsorderDetail.class) |
| | | .leftJoin(Goodsorder.class,Goodsorder::getId,GoodsorderDetail::getOrderId) |
| | | .eq(Goodsorder::getDistributionShopId,model.getMemberId()) |
| | | .in(Goodsorder::getStatus,Constants.OrderStatus.WAIT_PAY.getKey(), |
| | | Constants.OrderStatus.PAY_DONE.getKey(), |
| | | Constants.OrderStatus.WAIT_RECEIVE.getKey()) |
| | | ).stream().map(Goodsorder::getShopSettlement) |
| | | ).stream().map(GoodsorderDetail::getShopSettlement) |
| | | .reduce(BigDecimal.ZERO, BigDecimal::add) |
| | | ); |
| | | } |
| | |
| | | private List<Member> getMemberListByParam(MemberCouponAddDTO memberCoupon) { |
| | | List<Member> list = memberMapper.selectList(new QueryWrapper<Member>().lambda() |
| | | .eq(Member::getIsdeleted,Constants.ZERO) |
| | | .eq(Member::getStatus,Constants.ZERO) |
| | | .eq(memberCoupon.getAddType() == Constants.ZERO,Member::getId,memberCoupon.getAddMemberIds()) |
| | | .in(memberCoupon.getAddType() == Constants.ONE,Member::getPhone,memberCoupon.getPhones())); |
| | | if(list == null || list.size()==0){ |
| | |
| | | .apply(Objects.nonNull(status)&&Constants.equalsInteger(status,Constants.TWO),"m.STATUS = 0 and m.END_DATE < now() " ) |
| | | .eq("TYPE",couponType) |
| | | .apply(!Objects.isNull(price)," m.LIMIT_PRICE >= "+price+" ") |
| | | // .apply(" now() between m.START_DATE and m.END_DATE ") |
| | | .orderByDesc(" m.PRICE ") |
| | | .orderByDesc( " m.CREATE_DATE ") |
| | | ); |
| | | return page; |
| | | } |
| | |
| | | .apply(" now() between START_DATE and END_DATE ") |
| | | .orderByDesc(MemberCoupon::getMaxPrice) |
| | | .orderByAsc(MemberCoupon::getEndDate) |
| | | ) |
| | | ; |
| | | ); |
| | | |
| | | if(CollectionUtils.isNotEmpty(allCoupon)){ |
| | | for (MemberCoupon memberCoupon:allCoupon) { |
| | |
| | | @Autowired |
| | | private CouponMapper couponMapper; |
| | | @Autowired |
| | | private MemberCouponMapper memberCouponMapper; |
| | | @Autowired |
| | | private MemberCouponJoinMapper memberCouponJoinMapper; |
| | | @Autowired |
| | | private IntegralMapper integralMapper; |
| | |
| | | if(Objects.isNull(coupon)||Constants.equalsInteger(coupon.getIsdeleted(),Constants.ONE)&&num>Constants.ZERO){ |
| | | continue; |
| | | } |
| | | if(coupon.getNum()>Constants.ZERO) { |
| | | //查询已领取数量 |
| | | Integer getNum = memberCouponMapper.selectCount(new QueryWrapper<MemberCoupon>().lambda() |
| | | .eq(MemberCoupon::getIsdeleted, Constants.ZERO) |
| | | .eq(MemberCoupon::getCouponId, couponId) |
| | | .ne(MemberCoupon::getGetMethod, Constants.TWO) |
| | | ).intValue(); |
| | | if (getNum >= coupon.getNum()) { |
| | | continue; |
| | | } |
| | | if (num > (coupon.getNum() - getNum)) { |
| | | num = coupon.getNum().intValue() - getNum; |
| | | } |
| | | } |
| | | MemberCoupon memberCoupon = MemberCoupon.couponToBean(coupon,member,new Date(),Constants.ZERO,null); |
| | | for (int i = 0; i < num; i++) { |
| | | //满减卷不会生成maxPrice 需要根据优惠券减少金额设置 |
| | |
| | | //赠送邀请积分 |
| | | //开启邀请注册送积分 |
| | | if(Constants.equalsInteger(platformConfigDTO.getShareIntegralRewardStatus(),Constants.ZERO)){ |
| | | member = memberMapper.selectById(member.getRecId()); |
| | | if(Objects.isNull(member)){ |
| | | return; |
| | | } |
| | | DealIntegralRequest dealIntegralRequest = new DealIntegralRequest(); |
| | | dealIntegralRequest.setIntegralNum(platformConfigDTO.getShareIntegralReward()); |
| | | dealIntegralRequest.setDealType(Constants.ZERO); |
| | |
| | | dealIntegralRequest.setIntegralObjType(Constants.IntegralObjType.INVITENEWUSER); |
| | | dealIntegralRequest.setParam1(member.getNickname()); |
| | | integralService.dealIntegral(dealIntegralRequest,member); |
| | | //添加消息记录 |
| | | |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | this.verifyPhoneCode(request.getCode(),request.getPhone()); |
| | | memberMapper.update(new UpdateWrapper<Member>().lambda() |
| | | .eq(Member::getPhone,request.getPhone()) |
| | | .set(Member::getPhone,request.getPhone()) |
| | | .eq(Member::getId,request.getMemberId()) |
| | | ); |
| | | } |
| | |
| | | |
| | | Notice notice = pageWrap.getModel(); |
| | | |
| | | queryWrapper.ne(Objects.nonNull(notice.getQueryType()), |
| | | queryWrapper.eq(Objects.nonNull(notice.getQueryType()), |
| | | Notice::getType,notice.getQueryType()) |
| | | .eq(Notice::getMemberId,notice.getMemberId()) |
| | | .orderByAsc(Notice::getStatus) |
| | |
| | | .set(Shop::getProgramCode,url) |
| | | .eq(Shop::getId,shop.getId())); |
| | | } |
| | | if(StringUtils.isNotBlank(shop.getPosterImg())) { |
| | | //分享海报 |
| | | String posterUrl = inviteRecordService.createShareImg(Constants.ONE,shop.getId(),shop.getPosterImg()); |
| | | if(StringUtils.isNotBlank(posterUrl)){ |
| | | //生成失败会生成字符串 1 |
| | | if (StringUtils.isNotBlank(posterUrl)&&!posterUrl.equals("1")) { |
| | | shopMapper.update(null,new UpdateWrapper<Shop>().lambda() |
| | | .set(Shop::getPosterImgCode,posterUrl) |
| | | .eq(Shop::getId,shop.getId())); |
| | | } |
| | | } |
| | | return shop.getId(); |
| | | } |
| | |
| | | shop.setEditor(user.getId()); |
| | | shop.setEditDate(new Date()); |
| | | |
| | | if(StringUtils.isBlank(model.getProgramCode())){ |
| | | //分享码 |
| | | String url = inviteRecordService.createShopMiniProgramCode(shop.getId()); |
| | | if(StringUtils.isNotBlank(url)){ |
| | | shop.setProgramCode(url); |
| | | } |
| | | } |
| | | if(StringUtils.isNotBlank(shop.getPosterImg())){ |
| | | //分享海报 |
| | | String posterUrl = inviteRecordService.createShareImg(Constants.ONE,shop.getId(),shop.getPosterImg()); |
| | | if(StringUtils.isNotBlank(posterUrl)){ |
| | | //生成失败会生成字符串 1 |
| | | if (StringUtils.isNotBlank(posterUrl)&&!posterUrl.equals("1")) { |
| | | shop.setPosterImgCode(posterUrl); |
| | | } |
| | | } |
| | |
| | | shop.getEditDate(), |
| | | new String[]{user.getUsername(), DateUtil.getPlusTime2(shop.getEditDate())}, |
| | | JSONObject.toJSONString(shop) , |
| | | Constants.equalsInteger(model.getSaleType(),Constants.ONE)?"自由采购":"平台铺货", |
| | | Constants.equalsInteger(shop.getSaleType(),Constants.ONE)?"自由采购":"平台铺货"); |
| | | Constants.equalsInteger(model.getSaleType(),Constants.ONE)?"自主采购":"平台铺货", |
| | | Constants.equalsInteger(shop.getSaleType(),Constants.ONE)?"自主采购":"平台铺货"); |
| | | } |
| | | } |
| | | |
| | |
| | | if(!pwd.equals(shop.getPassword())){ |
| | | throw new BusinessException(ResponseStatus.ACCOUNT_INCORRECT); |
| | | } |
| | | shop.setOpenId(dto.getOpenid()); |
| | | //创建token |
| | | // JwtPayLoad payLoad = new JwtPayLoad(Constants.SHOP_PREFIX+shop.getId()); |
| | | // String token = JwtTokenUtil.generateToken(payLoad); |
| | |
| | | //自定义日期 |
| | | .apply(Objects.nonNull(request.getDateType())&&Constants.equalsInteger(request.getDateType(),Constants.FOUR)&&StringUtils.isNotBlank(request.getStartDate()), " t.CREATE_DATE >= '"+request.getStartDate()+" 00:00:00'") |
| | | .apply(Objects.nonNull(request.getDateType())&&Constants.equalsInteger(request.getDateType(),Constants.FOUR)&&StringUtils.isNotBlank(request.getEndDate()), " t.CREATE_DATE <= '"+request.getEndDate()+" 23:59:59'") |
| | | .ne(Goodsorder::getStatus,Constants.OrderStatus.CLOSE.getKey()) |
| | | .in(Goodsorder::getStatus,Constants.OrderStatus.PAY_DONE.getKey(),Constants.OrderStatus.WAIT_RECEIVE.getKey(),Constants.OrderStatus.DONE.getKey()) |
| | | .orderByDesc(Goodsorder::getId) |
| | | ); |
| | | |
| | | if (com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(goodsorderList)) { |
| | | saleReportResponse.setSaleTotal(goodsorderList.stream().map(i->i.getPrice().subtract(i.getMailPrice())).reduce(BigDecimal.ZERO, BigDecimal::add)); |
| | | saleReportResponse.setSaleTotal(goodsorderList.stream().map(i->i.getTotalPrice().subtract(i.getMailPrice())).reduce(BigDecimal.ZERO, BigDecimal::add)); |
| | | saleReportResponse.setOrderNum(goodsorderList.size()); |
| | | } |
| | | List<Integral> integralList = integralMapper.selectList(new QueryWrapper<Integral>().lambda() |
| | | .eq(Integral::getIsdeleted,Constants.ZERO) |
| | | .eq(Integral::getMemberId,shopId) |
| | | .eq(Integral::getUserType,Constants.TWO) |
| | | .eq(Integral::getType,Constants.ZERO) |
| | | .eq(Integral::getObjType,Constants.IntegralObjType.ORDER_DONE_AMOUNT.getKey()) |
| | | // List<Integral> integralList = integralMapper.selectList(new QueryWrapper<Integral>().lambda() |
| | | // .eq(Integral::getIsdeleted,Constants.ZERO) |
| | | // .eq(Integral::getMemberId,shopId) |
| | | // .eq(Integral::getUserType,Constants.TWO) |
| | | // .eq(Integral::getType,Constants.ZERO) |
| | | // .eq(Integral::getObjType,Constants.IntegralObjType.ORDER_DONE_AMOUNT.getKey()) |
| | | // //今日 |
| | | // .apply(Constants.equalsInteger(request.getDateType(),Constants.ZERO), " DATE(CREATE_DATE) = DATE(NOW()) ") |
| | | // //当月 |
| | | // .apply(Constants.equalsInteger(request.getDateType(),Constants.ONE), " DATE_FORMAT(CREATE_DATE, '%Y-%m') = DATE_FORMAT(NOW(), '%Y-%m')") |
| | | // //上月 |
| | | // .apply(Constants.equalsInteger(request.getDateType(),Constants.TWO), " DATE_FORMAT(CREATE_DATE, '%Y-%m') = DATE_FORMAT(DATE_SUB(CURDATE(), INTERVAL 1 MONTH), '%Y-%m') ") |
| | | // //固定月份 |
| | | // .apply(Constants.equalsInteger(request.getDateType(),Constants.THREE)&&StringUtils.isNotBlank(request.getStartDate()), " DATE_FORMAT(CREATE_DATE, '%Y-%m') = DATE_FORMAT(DATE_SUB('"+request.getStartDate()+"', INTERVAL 1 MONTH), '%Y-%m') ") |
| | | // //自定义日期 |
| | | // .apply(Constants.equalsInteger(request.getDateType(),Constants.FOUR)&&StringUtils.isNotBlank(request.getStartDate()), " CREATE_DATE >= '"+request.getStartDate()+" 00:00:00'") |
| | | // .apply(Constants.equalsInteger(request.getDateType(),Constants.FOUR)&&StringUtils.isNotBlank(request.getEndDate()), " CREATE_DATE <= '"+request.getEndDate()+" 23:59:59'") |
| | | // ); |
| | | goodsorderList = goodsorderJoinMapper.selectJoinList(Goodsorder.class, |
| | | new MPJLambdaWrapper<Goodsorder>() |
| | | .selectAll(Goodsorder.class) |
| | | .eq(Goodsorder::getIsdeleted,Constants.ZERO) |
| | | .eq(Goodsorder::getDistributionShopId,shopId) |
| | | //今日 |
| | | .apply(Constants.equalsInteger(request.getDateType(),Constants.ZERO), " DATE(CREATE_DATE) = DATE(NOW()) ") |
| | | .apply(Objects.nonNull(request.getDateType())&&Constants.equalsInteger(request.getDateType(),Constants.ZERO), " DATE(t.DONE_DATE) = DATE(NOW()) ") |
| | | //当月 |
| | | .apply(Constants.equalsInteger(request.getDateType(),Constants.ONE), " DATE_FORMAT(CREATE_DATE, '%Y-%m') = DATE_FORMAT(NOW(), '%Y-%m')") |
| | | .apply(Objects.nonNull(request.getDateType())&&Constants.equalsInteger(request.getDateType(),Constants.ONE), " DATE_FORMAT(t.DONE_DATE, '%Y-%m') = DATE_FORMAT(NOW(), '%Y-%m')") |
| | | //上月 |
| | | .apply(Constants.equalsInteger(request.getDateType(),Constants.TWO), " DATE_FORMAT(CREATE_DATE, '%Y-%m') = DATE_FORMAT(DATE_SUB(CURDATE(), INTERVAL 1 MONTH), '%Y-%m') ") |
| | | .apply(Objects.nonNull(request.getDateType())&&Constants.equalsInteger(request.getDateType(),Constants.TWO), " DATE_FORMAT(t.DONE_DATE, '%Y-%m') = DATE_FORMAT(DATE_SUB(CURDATE(), INTERVAL 1 MONTH), '%Y-%m') ") |
| | | //固定月份 |
| | | .apply(Constants.equalsInteger(request.getDateType(),Constants.THREE)&&StringUtils.isNotBlank(request.getStartDate()), " DATE_FORMAT(CREATE_DATE, '%Y-%m') = DATE_FORMAT(DATE_SUB('"+request.getStartDate()+"', INTERVAL 1 MONTH), '%Y-%m') ") |
| | | .apply(Objects.nonNull(request.getDateType())&&Constants.equalsInteger(request.getDateType(),Constants.THREE)&&StringUtils.isNotBlank(request.getStartDate()), " DATE_FORMAT(t.DONE_DATE, '%Y-%m') = DATE_FORMAT(DATE_SUB('"+request.getStartDate()+"', INTERVAL 1 MONTH), '%Y-%m') ") |
| | | //自定义日期 |
| | | .apply(Constants.equalsInteger(request.getDateType(),Constants.FOUR)&&StringUtils.isNotBlank(request.getStartDate()), " CREATE_DATE >= '"+request.getStartDate()+" 00:00:00'") |
| | | .apply(Constants.equalsInteger(request.getDateType(),Constants.FOUR)&&StringUtils.isNotBlank(request.getEndDate()), " CREATE_DATE <= '"+request.getEndDate()+" 23:59:59'") |
| | | .apply(Objects.nonNull(request.getDateType())&&Constants.equalsInteger(request.getDateType(),Constants.FOUR)&&StringUtils.isNotBlank(request.getStartDate()), " t.DONE_DATE >= '"+request.getStartDate()+" 00:00:00'") |
| | | .apply(Objects.nonNull(request.getDateType())&&Constants.equalsInteger(request.getDateType(),Constants.FOUR)&&StringUtils.isNotBlank(request.getEndDate()), " t.DONE_DATE <= '"+request.getEndDate()+" 23:59:59'") |
| | | .in(Goodsorder::getStatus,Constants.OrderStatus.DONE.getKey()) |
| | | .orderByDesc(Goodsorder::getId) |
| | | ); |
| | | if (com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(integralList)) { |
| | | saleReportResponse.setProfitTotal(integralList.stream().map(i->i.getNum()).reduce(BigDecimal.ZERO, BigDecimal::add)); |
| | | if (com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(goodsorderList)) { |
| | | saleReportResponse.setProfitTotal(goodsorderList.stream().filter(i->Objects.nonNull(i.getShopSettlement())).map(i->i.getShopSettlement()).reduce(BigDecimal.ZERO, BigDecimal::add)); |
| | | } |
| | | return saleReportResponse; |
| | | } |
| | |
| | | * @param addCartGoodsRequest |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @Transactional(rollbackFor = {Exception.class,BusinessException.class}) |
| | | public void addCart(AddCartGoodsRequest addCartGoodsRequest){ |
| | | //查询购物车是否存在当前选中的商品信息 |
| | | Shopcart shopcart = shopcartMapper.selectOne(new QueryWrapper<Shopcart>() |
| | |
| | | mchId: 1229817002 |
| | | mchKey: u4TSNtv0wFP7WRfnxBgijYOtRhS9FvlM |
| | | notifyUrl: https://test.doumee.cn/dmmall_web_api/web/api/wxPayNotify |
| | | keyPath: /usr/local/apiclient_cert.p12 |
| | | keyPath: /usr/local/apiclient_cert.p12 #D:\DouMee\dmkjWxcert\apiclient_cert.p12 # |
| | | |
| | | #wx: |
| | | # pay: |
| | | # appId: wx0115b948d647e9b2 |
| | | # appSecret: 4b5b97d6770f1fc6b09a7019804739a7 |
| | | # mchId: 1739990831 |
| | | # mchKey: u4TSNtv0wFP7WRfnxBgijYOtRhS9FvlM |
| | | # notifyUrl: http://xiaopiqiu2.natapp1.cc/web/api/wxPayNotify #https://test.doumee.cn/dmmall_web_api/web/api/wxPayNotify |
| | | # keyPath: D:\DouMee\1739990831_20260306_cert #D:\DouMee\dmkjWxcert\apiclient_cert.p12 # |
| | | |
| | | tencent: |
| | | map: |
| | |
| | | spring: |
| | | # 数据源配置 |
| | | datasource: |
| | | url: jdbc:mysql://192.168.0.211:3306/dmmall_full?useUnicode=true&characterEncoding=utf8&serverTimezone=Asia/Shanghai |
| | | username: root |
| | | password: Doumee@168 |
| | | url: jdbc:mysql://rm-uf6916tp3306gqv43vo.mysql.rds.aliyuncs.com:3306/dynj?useUnicode=true&characterEncoding=utf8&serverTimezone=Asia/Shanghai |
| | | username: dynj |
| | | password: dynj@2026 |
| | | driver-class-name: com.mysql.cj.jdbc.Driver |
| | | type: com.alibaba.druid.pool.DruidDataSource |
| | | |
| | |
| | | ########################微信支付相关配置######################## |
| | | wx: |
| | | pay: |
| | | appId: wxcd2b89fd2ff065f8 |
| | | appId: wx0115b948d647e9b2 |
| | | appSecret: 3462fa186da7cb06c544df8d8664b63a |
| | | mchId: 1229817002 |
| | | mchKey: u4TSNtv0wFP7WRfnxBgijYOtRhS9FvlM |
| | | notifyUrl: https://dmtest.ahapp.net/dmmall_interface/web/api/wxPayNotify |
| | | keyPath: /usr/local/apiclient_cert.p12 |
| | | notifyUrl: https://mall.myshopify.com/dmmall_interface/web/api/wxPayNotify |
| | | keyPath: /usr/local/jars/apiclient_cert.p12 |
| | | |
| | | tencent: |
| | | map: |
| | |
| | | role.`ID` AS ROLE_ID, role.`CODE` AS ROLE_CODE, role.`NAME` AS ROLE_NAME, |
| | | create_user.ID CREATE_USER_ID, create_user.`USERNAME` CREATE_USER_NAME, |
| | | update_user.ID UPDETE_USER_ID, update_user.`USERNAME` UPDATE_USER_NAME |
| | | FROM SYSTEM_DATA_PERMISSION sdp |
| | | INNER JOIN `SYSTEM_ROLE` role ON role.ID = sdp.ROLE_ID |
| | | LEFT JOIN `SYSTEM_USER` create_user ON create_user.ID = sdp.CREATE_USER |
| | | LEFT JOIN `SYSTEM_USER` update_user ON update_user.ID = sdp.UPDATE_USER |
| | | FROM system_data_permission sdp |
| | | INNER JOIN `system_role` role ON role.ID = sdp.ROLE_ID |
| | | LEFT JOIN `system_user` create_user ON create_user.ID = sdp.CREATE_USER |
| | | LEFT JOIN `system_user` update_user ON update_user.ID = sdp.UPDATE_USER |
| | | <where> |
| | | sdp.DELETED = 0 |
| | | <if test="dto.businessCode != null and dto.businessCode != ''"> |
| | |
| | | create_user.ID CREATE_USER_ID, create_user.`USERNAME` CREATE_USER_NAME, |
| | | update_user.ID UPDETE_USER_ID, update_user.`USERNAME` UPDATE_USER_NAME, |
| | | COUNT(usr.ID) USER_COUNT |
| | | FROM SYSTEM_DEPARTMENT dept |
| | | LEFT JOIN `SYSTEM_DEPARTMENT_USER` sdu ON sdu.DEPARTMENT_ID = dept.ID AND sdu.DELETED = 0 |
| | | LEFT JOIN `SYSTEM_USER` usr ON usr.ID = sdu.USER_ID AND usr.DELETED = 0 |
| | | LEFT JOIN `SYSTEM_USER` create_user ON create_user.ID = dept.CREATE_USER |
| | | LEFT JOIN `SYSTEM_USER` update_user ON update_user.ID = dept.UPDATE_USER |
| | | FROM system_department dept |
| | | LEFT JOIN `system_department_user` sdu ON sdu.DEPARTMENT_ID = dept.ID AND sdu.DELETED = 0 |
| | | LEFT JOIN `system_user` usr ON usr.ID = sdu.USER_ID AND usr.DELETED = 0 |
| | | LEFT JOIN `system_user` create_user ON create_user.ID = dept.CREATE_USER |
| | | LEFT JOIN `system_user` update_user ON update_user.ID = dept.UPDATE_USER |
| | | <where> |
| | | dept.DELETED = 0 |
| | | <if test="id != null"> |
| | |
| | | dict_data.`ID`, dict_data.`remark`, dict_data.`DICT_ID`, dict_data.`CODE`, dict_data.`LABEL`, dict_data.`SORT`, dict_data.`DISABLED`, dict_data.`CREATE_TIME`, dict_data.`UPDATE_TIME`, dict_data.`CREATE_USER`, dict_data.`UPDATE_USER`, |
| | | create_user.ID CREATE_USER_ID, create_user.`USERNAME` CREATE_USER_NAME, |
| | | update_user.ID UPDETE_USER_ID, update_user.`USERNAME` UPDATE_USER_NAME |
| | | FROM SYSTEM_DICT_DATA dict_data |
| | | LEFT JOIN `SYSTEM_USER` create_user ON create_user.ID = dict_data.CREATE_USER |
| | | LEFT JOIN `SYSTEM_USER` update_user ON update_user.ID = dict_data.UPDATE_USER |
| | | FROM system_dict_data dict_data |
| | | LEFT JOIN `system_user` create_user ON create_user.ID = dict_data.CREATE_USER |
| | | LEFT JOIN `system_user` update_user ON update_user.ID = dict_data.UPDATE_USER |
| | | <where> |
| | | dict_data.DELETED = 0 |
| | | <if test="dictId != null"> |
| | |
| | | dict.`ID`, dict.`CODE`, dict.`NAME`, dict.`REMARK`, dict.`CREATE_TIME`, dict.`UPDATE_TIME`, dict.`CREATE_USER`, dict.`UPDATE_USER`, |
| | | create_user.ID CREATE_USER_ID, create_user.`USERNAME` CREATE_USER_NAME, |
| | | update_user.ID UPDETE_USER_ID, update_user.`USERNAME` UPDATE_USER_NAME |
| | | FROM SYSTEM_DICT dict |
| | | LEFT JOIN `SYSTEM_USER` create_user ON create_user.ID = dict.CREATE_USER |
| | | LEFT JOIN `SYSTEM_USER` update_user ON update_user.ID = dict.UPDATE_USER |
| | | FROM system_dict dict |
| | | LEFT JOIN `system_user` create_user ON create_user.ID = dict.CREATE_USER |
| | | LEFT JOIN `system_user` update_user ON update_user.ID = dict.UPDATE_USER |
| | | <where> |
| | | dict.DELETED = 0 |
| | | <if test="dto.code != null and dto.code != ''"> |
| | |
| | | menu.`ID`, menu.`PARENT_ID`, menu.`NAME`, menu.`PATH`, menu.`FIXED`, menu.`REMARK`, menu.`DISABLED`, menu.SORT, menu.`ICON`, menu.`CREATE_TIME`, menu.`UPDATE_TIME`, menu.`CREATE_USER`, menu.`UPDATE_USER`, menu.`DELETED`, |
| | | create_user.ID CREATE_USER_ID, create_user.`USERNAME` CREATE_USER_NAME, |
| | | update_user.ID UPDETE_USER_ID, update_user.`USERNAME` UPDATE_USER_NAME |
| | | FROM SYSTEM_MENU menu |
| | | LEFT JOIN `SYSTEM_USER` create_user ON create_user.ID = menu.CREATE_USER |
| | | LEFT JOIN `SYSTEM_USER` update_user ON update_user.ID = menu.UPDATE_USER |
| | | FROM system_menu menu |
| | | LEFT JOIN `system_user` create_user ON create_user.ID = menu.CREATE_USER |
| | | LEFT JOIN `system_user` update_user ON update_user.ID = menu.UPDATE_USER |
| | | <where> |
| | | menu.DELETED = 0 |
| | | </where> |
| | |
| | | <select id="selectByUserId" parameterType="java.lang.Integer" resultType="com.doumee.dao.system.model.SystemMenu"> |
| | | SELECT |
| | | DISTINCT menu.`ID`, menu.`PARENT_ID`, menu.`NAME`, menu.`PATH`, menu.`REMARK`, menu.`DISABLED`, menu.SORT, menu.`ICON`, menu.`CREATE_TIME`, menu.`UPDATE_TIME`, menu.`CREATE_USER`, menu.`UPDATE_USER`, menu.`DELETED` |
| | | FROM `SYSTEM_MENU` menu |
| | | INNER JOIN SYSTEM_ROLE_MENU role_menu ON role_menu.MENU_ID = menu.ID AND role_menu.DELETED = 0 |
| | | INNER JOIN SYSTEM_USER_ROLE user_role ON user_role.ROLE_ID = role_menu.ROLE_ID AND user_role.DELETED = 0 |
| | | FROM `system_menu` menu |
| | | INNER JOIN system_role_menu role_menu ON role_menu.MENU_ID = menu.ID AND role_menu.DELETED = 0 |
| | | INNER JOIN system_user_role user_role ON user_role.ROLE_ID = role_menu.ROLE_ID AND user_role.DELETED = 0 |
| | | <where> |
| | | AND menu.DELETED = 0 |
| | | AND menu.DISABLED = 0 |
| | |
| | | <select id="selectByRoleId" parameterType="java.lang.Integer" resultType="com.doumee.dao.system.model.SystemMenu"> |
| | | SELECT |
| | | menu.`ID`, menu.`PARENT_ID`, menu.`NAME`, menu.`PATH`, menu.`REMARK`, menu.`DISABLED`, menu.SORT, menu.`ICON`, menu.`CREATE_TIME`, menu.`UPDATE_TIME`, menu.`CREATE_USER`, menu.`UPDATE_USER`, menu.`DELETED` |
| | | FROM `SYSTEM_MENU` menu |
| | | INNER JOIN `SYSTEM_ROLE_MENU` role_menu ON role_menu.MENU_ID = menu.ID AND role_menu.DELETED = 0 |
| | | FROM `system_menu` menu |
| | | INNER JOIN `system_role_menu` role_menu ON role_menu.MENU_ID = menu.ID AND role_menu.DELETED = 0 |
| | | <where> |
| | | menu.DELETED = 0 |
| | | AND role_menu.ROLE_ID = #{roleId} |
| | |
| | | perm.`ID`, perm.`CODE`, perm.`NAME`, perm.`REMARK`, perm.`FIXED`, perm.`CREATE_TIME`, perm.`UPDATE_TIME`, perm.`CREATE_USER`, perm.`UPDATE_USER`, perm.`DELETED`, |
| | | create_user.ID CREATE_USER_ID, create_user.`USERNAME` CREATE_USER_NAME, |
| | | update_user.ID UPDETE_USER_ID, update_user.`USERNAME` UPDATE_USER_NAME |
| | | FROM SYSTEM_PERMISSION perm |
| | | LEFT JOIN `SYSTEM_USER` create_user ON create_user.ID = perm.CREATE_USER |
| | | LEFT JOIN `SYSTEM_USER` update_user ON update_user.ID = perm.UPDATE_USER |
| | | FROM system_permission perm |
| | | LEFT JOIN `system_user` create_user ON create_user.ID = perm.CREATE_USER |
| | | LEFT JOIN `system_user` update_user ON update_user.ID = perm.UPDATE_USER |
| | | <where> |
| | | perm.DELETED = 0 |
| | | <if test="dto.code != null"> |
| | |
| | | <select id="selectByUserId" parameterType="java.lang.Integer" resultType="com.doumee.dao.system.model.SystemPermission"> |
| | | SELECT |
| | | perm.`ID`, perm.`CODE`, perm.`NAME`, perm.`REMARK`, perm.`CREATE_TIME`, perm.`UPDATE_TIME`, perm.`CREATE_USER`, perm.`UPDATE_USER`, perm.`DELETED` |
| | | FROM SYSTEM_PERMISSION perm |
| | | INNER JOIN SYSTEM_ROLE_PERMISSION role_perm ON role_perm.PERMISSION_ID = perm.ID AND role_perm.DELETED = 0 |
| | | INNER JOIN SYSTEM_ROLE role ON role.ID = role_perm.ROLE_ID AND role.DELETED = 0 |
| | | INNER JOIN SYSTEM_USER_ROLE user_role ON user_role.ROLE_ID = role.ID AND user_role.DELETED = 0 |
| | | FROM system_permission perm |
| | | INNER JOIN system_role_permission role_perm ON role_perm.PERMISSION_ID = perm.ID AND role_perm.DELETED = 0 |
| | | INNER JOIN system_role role ON role.ID = role_perm.ROLE_ID AND role.DELETED = 0 |
| | | INNER JOIN system_user_role user_role ON user_role.ROLE_ID = role.ID AND user_role.DELETED = 0 |
| | | <where> |
| | | perm.DELETED = 0 |
| | | AND user_role.USER_ID = #{userId} |
| | |
| | | <select id="selectByRoleId" parameterType="java.lang.Integer" resultType="com.doumee.dao.system.model.SystemPermission"> |
| | | SELECT |
| | | perm.`ID`, perm.`CODE`, perm.`NAME`, perm.`REMARK`, perm.`CREATE_TIME`, perm.`UPDATE_TIME`, perm.`CREATE_USER`, perm.`UPDATE_USER`, perm.`DELETED` |
| | | FROM SYSTEM_PERMISSION perm |
| | | INNER JOIN SYSTEM_ROLE_PERMISSION role_perm ON role_perm.PERMISSION_ID = perm.ID AND role_perm.DELETED = 0 |
| | | FROM system_permission perm |
| | | INNER JOIN system_role_permission role_perm ON role_perm.PERMISSION_ID = perm.ID AND role_perm.DELETED = 0 |
| | | <where> |
| | | perm.DELETED = 0 |
| | | AND role_perm.ROLE_ID = #{roleId} |
| | |
| | | create_user.ID CREATE_USER_ID, create_user.`USERNAME` CREATE_USER_NAME, |
| | | update_user.ID UPDETE_USER_ID, update_user.`USERNAME` UPDATE_USER_NAME, |
| | | COUNT(usr.ID) USER_COUNT |
| | | FROM SYSTEM_POSITION posi |
| | | LEFT JOIN `SYSTEM_POSITION_USER` spu ON spu.POSITION_ID = posi.ID AND spu.DELETED = 0 |
| | | LEFT JOIN `SYSTEM_USER` usr ON usr.ID = spu.USER_ID AND usr.DELETED = 0 |
| | | LEFT JOIN `SYSTEM_USER` create_user ON create_user.ID = posi.CREATE_USER |
| | | LEFT JOIN `SYSTEM_USER` update_user ON update_user.ID = posi.UPDATE_USER |
| | | FROM system_position posi |
| | | LEFT JOIN `system_position_user` spu ON spu.POSITION_ID = posi.ID AND spu.DELETED = 0 |
| | | LEFT JOIN `system_user` usr ON usr.ID = spu.USER_ID AND usr.DELETED = 0 |
| | | LEFT JOIN `system_user` create_user ON create_user.ID = posi.CREATE_USER |
| | | LEFT JOIN `system_user` update_user ON update_user.ID = posi.UPDATE_USER |
| | | <where> |
| | | posi.DELETED = 0 |
| | | <if test="name != null and name != ''"> |
| | |
| | | <select id="selectByUserId" parameterType="java.lang.Integer" resultType="com.doumee.dao.system.model.SystemPosition"> |
| | | SELECT |
| | | sp.`ID`, sp.`PARENT_ID`, sp.`CODE`, sp.`NAME` |
| | | FROM `SYSTEM_POSITION` sp |
| | | INNER JOIN `SYSTEM_POSITION_USER` spu ON spu.`POSITION_ID` = sp.`ID` AND spu.`DELETED` = 0 |
| | | INNER JOIN `SYSTEM_USER` su ON su.`ID` = spu.`USER_ID` |
| | | FROM `system_position` sp |
| | | INNER JOIN `system_position_user` spu ON spu.`POSITION_ID` = sp.`ID` AND spu.`DELETED` = 0 |
| | | INNER JOIN `system_user` su ON su.`ID` = spu.`USER_ID` |
| | | <where> |
| | | sp.DELETED = 0 |
| | | AND spu.USER_ID = #{userId} |
| | |
| | | role.ID, role.`CODE`, role.`NAME`, role.`REMARK`, role.`FIXED`, role.`CREATE_TIME`, role.`UPDATE_TIME`, |
| | | create_user.ID CREATE_USER_ID, create_user.`USERNAME` CREATE_USER_NAME, |
| | | update_user.ID UPDETE_USER_ID, update_user.`USERNAME` UPDATE_USER_NAME |
| | | FROM SYSTEM_ROLE role |
| | | LEFT JOIN `SYSTEM_USER` create_user ON create_user.ID = role.CREATE_USER |
| | | LEFT JOIN `SYSTEM_USER` update_user ON update_user.ID = role.UPDATE_USER |
| | | FROM system_role role |
| | | LEFT JOIN `system_user` create_user ON create_user.ID = role.CREATE_USER |
| | | LEFT JOIN `system_user` update_user ON update_user.ID = role.UPDATE_USER |
| | | <where> |
| | | role.DELETED = 0 |
| | | <if test="dto.code != null and dto.code != ''"> |
| | |
| | | <select id="selectByUserId" parameterType="java.lang.Integer" resultType="com.doumee.dao.system.model.SystemRole"> |
| | | SELECT |
| | | role.ID, role.`CODE`, role.`NAME`, role.`REMARK`, role.`CREATE_TIME`, role.`UPDATE_TIME` |
| | | FROM SYSTEM_ROLE role |
| | | INNER JOIN SYSTEM_USER_ROLE user_role ON user_role.ROLE_ID = role.ID AND user_role.DELETED = 0 |
| | | FROM system_role role |
| | | INNER JOIN system_user_role user_role ON user_role.ROLE_ID = role.ID AND user_role.DELETED = 0 |
| | | <where> |
| | | role.DELETED = 0 |
| | | AND user_role.USER_ID = #{userId} |
| | |
| | | sd.ID AS DEPARTMENT_ID, sd.`NAME` AS DEPARTMENT_NAME, |
| | | create_user.ID CREATE_USER_ID, create_user.`USERNAME` CREATE_USER_NAME, |
| | | update_user.ID UPDETE_USER_ID, update_user.`USERNAME` UPDATE_USER_NAME |
| | | FROM `SYSTEM_USER` usr |
| | | LEFT JOIN `SYSTEM_USER` create_user ON create_user.ID = usr.CREATE_USER |
| | | LEFT JOIN `SYSTEM_USER` update_user ON update_user.ID = usr.UPDATE_USER |
| | | LEFT JOIN `SYSTEM_POSITION_USER` spu ON spu.USER_ID = usr.ID AND spu.DELETED = 0 |
| | | LEFT JOIN `SYSTEM_POSITION` sp ON sp.ID = spu.POSITION_ID AND sp.DELETED = 0 |
| | | LEFT JOIN `SYSTEM_DEPARTMENT_USER` sdu ON sdu.USER_ID = usr.ID AND sdu.DELETED = 0 |
| | | LEFT JOIN `SYSTEM_DEPARTMENT` sd ON sd.ID = sdu.DEPARTMENT_ID AND sd.DELETED = 0 |
| | | FROM `system_user` usr |
| | | LEFT JOIN `system_user` create_user ON create_user.ID = usr.CREATE_USER |
| | | LEFT JOIN `system_user` update_user ON update_user.ID = usr.UPDATE_USER |
| | | LEFT JOIN `system_position_user` spu ON spu.USER_ID = usr.ID AND spu.DELETED = 0 |
| | | LEFT JOIN `system_position` sp ON sp.ID = spu.POSITION_ID AND sp.DELETED = 0 |
| | | LEFT JOIN `system_department_user` sdu ON sdu.USER_ID = usr.ID AND sdu.DELETED = 0 |
| | | LEFT JOIN `system_department` sd ON sd.ID = sdu.DEPARTMENT_ID AND sd.DELETED = 0 |
| | | <where> |
| | | usr.DELETED = 0 |
| | | <if test="dto.positionId != null"> |
| | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.apache.shiro.authz.annotation.RequiresPermissions; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | /** |
| | | * @author 江蹄蹄 |
| | |
| | | } |
| | | |
| | | |
| | | @LoginRequired |
| | | @ApiOperation("删除评论") |
| | | @GetMapping("/delete/{id}") |
| | | public ApiResponse deleteById(@PathVariable Integer id) { |
| | | commentService.deleteById(id,getMemberId()); |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 分页活动探店评论查询 |
| | | * |
| | |
| | | # application: |
| | | # name: doumeemes |
| | | profiles: |
| | | active: dev |
| | | active: pro |
| | | |
| | | # JSON返回配置 |
| | | jackson: |