| @@ -2,10 +2,13 @@ package com.iformall.controller.basic; | |||||
| import com.google.code.kaptcha.Constants; | import com.google.code.kaptcha.Constants; | ||||
| import com.iformall.annotation.SystemControllerLog; | import com.iformall.annotation.SystemControllerLog; | ||||
| import com.iformall.common.ErrorCode; | |||||
| import com.iformall.common.Result; | import com.iformall.common.Result; | ||||
| import com.iformall.common.ResultData; | import com.iformall.common.ResultData; | ||||
| import com.iformall.controller.base.BaseController; | import com.iformall.controller.base.BaseController; | ||||
| import com.iformall.domain.po.TtMallIm; | |||||
| import com.iformall.domain.po.WxMall; | import com.iformall.domain.po.WxMall; | ||||
| import com.iformall.domain.po.WxMallNoticeContact; | |||||
| import com.iformall.enums.EnumGroupSupport; | import com.iformall.enums.EnumGroupSupport; | ||||
| import com.iformall.service.WxMallService; | import com.iformall.service.WxMallService; | ||||
| import com.iformall.utils.ShiroUtils; | import com.iformall.utils.ShiroUtils; | ||||
| @@ -97,4 +100,24 @@ public class WxMallController extends BaseController { | |||||
| } | } | ||||
| @ApiOperation("根据id查询") | |||||
| @GetMapping("/noticeContact") | |||||
| @SystemControllerLog(description = "商城-查询通知配置") | |||||
| public ResultData noticeContact() { | |||||
| logger.debug("[" + getIpAddr() + "] WxMallController::noticeContact"); | |||||
| WxMallNoticeContact noticeContact = wxMallService.getNoticeContact(getTenantInfo()); | |||||
| return new ResultData(noticeContact); | |||||
| } | |||||
| @ApiOperation("更新接口") | |||||
| @PostMapping("saveNoticeContact") | |||||
| @SystemControllerLog(description = "更新") | |||||
| public ResultData saveNoticeContact(@RequestBody WxMallNoticeContact record) { | |||||
| logger.debug("[" + getIpAddr() + "] WxMallController::saveNoticeContact"); | |||||
| record.updateTenantInfo(getTenantInfo()); | |||||
| wxMallService.saveNoticeContact(record); | |||||
| return new ResultData(record); | |||||
| } | |||||
| } | } | ||||
| @@ -154,7 +154,7 @@ public class WxCoupon extends TenantEntity { | |||||
| private Integer inventory; | private Integer inventory; | ||||
| @io.swagger.annotations.ApiModelProperty(value="购买须知",name="remark") | @io.swagger.annotations.ApiModelProperty(value="购买须知",name="remark") | ||||
| private String remark; | private String remark; | ||||
| @io.swagger.annotations.ApiModelProperty(value="EnumCouponStatus 状态(-1:全部,0:草稿/待生效,1:已生效,2:已失效,3:已作废)",name="status") | |||||
| @io.swagger.annotations.ApiModelProperty(value="EnumCouponStatus ",name="status") | |||||
| private Integer status; | private Integer status; | ||||
| @io.swagger.annotations.ApiModelProperty(value="创建时间",name="createDate") | @io.swagger.annotations.ApiModelProperty(value="创建时间",name="createDate") | ||||
| private Date createDate; | private Date createDate; | ||||
| @@ -0,0 +1,31 @@ | |||||
| package com.iformall.domain.po; | |||||
| import com.baomidou.mybatisplus.annotation.IdType; | |||||
| import com.baomidou.mybatisplus.annotation.TableId; | |||||
| import com.baomidou.mybatisplus.annotation.TableName; | |||||
| import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | |||||
| import com.iformall.domain.po.base.TenantEntity; | |||||
| import lombok.Data; | |||||
| import lombok.EqualsAndHashCode; | |||||
| @JsonIgnoreProperties(value = {"handler"}) | |||||
| @TableName(value = "wx_mall_notice_contact") | |||||
| @Data | |||||
| @EqualsAndHashCode(callSuper = true) | |||||
| public class WxMallNoticeContact extends TenantEntity { | |||||
| @TableId(type= IdType.AUTO) | |||||
| protected Long id; | |||||
| @io.swagger.annotations.ApiModelProperty(value="",name="phone") | |||||
| private String phone; | |||||
| @io.swagger.annotations.ApiModelProperty(value="通知开关",name="phoneEnabled") | |||||
| private Integer phoneEnabled; | |||||
| @io.swagger.annotations.ApiModelProperty(value="",name="email") | |||||
| private String email; | |||||
| @io.swagger.annotations.ApiModelProperty(value="抖音应用版本EnumDouyinApplicationVersion",name="douyinApplictionVersion") | |||||
| private Integer emailEnabled; | |||||
| } | |||||
| @@ -0,0 +1,17 @@ | |||||
| package com.iformall.mapper; | |||||
| import com.iformall.common.CommonMapper; | |||||
| import com.iformall.domain.po.WxMallNoticeContact; | |||||
| import com.iformall.domain.po.WxMallVersion; | |||||
| import com.iformall.domain.po.base.TenantEntity; | |||||
| import java.util.List; | |||||
| public interface WxMallNoticeContactMapper extends CommonMapper<WxMallNoticeContact, Long> { | |||||
| List<WxMallNoticeContact> findList(WxMallNoticeContact wxMall); | |||||
| WxMallNoticeContact getByTenantId(String tenantId); | |||||
| WxMallNoticeContact getByTenantInfo(TenantEntity tenantEntity); | |||||
| } | |||||
| @@ -2,6 +2,7 @@ package com.iformall.service; | |||||
| import com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| import com.iformall.common.ResultData; | import com.iformall.common.ResultData; | ||||
| import com.iformall.domain.po.WxMallNoticeContact; | |||||
| import com.iformall.domain.po.WxProjectConfig; | import com.iformall.domain.po.WxProjectConfig; | ||||
| import com.iformall.domain.po.base.TenantEntity; | import com.iformall.domain.po.base.TenantEntity; | ||||
| import com.iformall.domain.po.WxMall; | import com.iformall.domain.po.WxMall; | ||||
| @@ -102,4 +103,9 @@ public interface WxMallService { | |||||
| EnumDouyinApplicationVersion getDouyinApplicationVersion(TenantEntity tenantEntity); | EnumDouyinApplicationVersion getDouyinApplicationVersion(TenantEntity tenantEntity); | ||||
| WxMall getRandomMall(String randmKey, String tenantId); | WxMall getRandomMall(String randmKey, String tenantId); | ||||
| WxMallNoticeContact getNoticeContact(TenantEntity tenantInfo); | |||||
| void saveNoticeContact(WxMallNoticeContact record); | |||||
| } | } | ||||
| @@ -10,10 +10,7 @@ import com.iformall.domain.po.*; | |||||
| import com.iformall.domain.po.base.TenantEntity; | import com.iformall.domain.po.base.TenantEntity; | ||||
| import com.iformall.enums.*; | import com.iformall.enums.*; | ||||
| import com.iformall.exception.MallinkException; | import com.iformall.exception.MallinkException; | ||||
| import com.iformall.mapper.WxMallBuildingMapper; | |||||
| import com.iformall.mapper.WxMallFloorMapper; | |||||
| import com.iformall.mapper.WxMallMapper; | |||||
| import com.iformall.mapper.WxMallVersionMapper; | |||||
| import com.iformall.mapper.*; | |||||
| import com.iformall.service.MallUserInfoService; | import com.iformall.service.MallUserInfoService; | ||||
| import com.iformall.service.WxMallService; | import com.iformall.service.WxMallService; | ||||
| import com.iformall.utils.Constant; | import com.iformall.utils.Constant; | ||||
| @@ -63,6 +60,9 @@ public class WxMallServiceImpl implements WxMallService { | |||||
| @Autowired | @Autowired | ||||
| WxMallVersionMapper wxMallVersionMapper; | WxMallVersionMapper wxMallVersionMapper; | ||||
| @Autowired | |||||
| WxMallNoticeContactMapper wxMallNoticeContactMapper; | |||||
| @Override | @Override | ||||
| @@ -459,4 +459,24 @@ public class WxMallServiceImpl implements WxMallService { | |||||
| return mall; | return mall; | ||||
| } | } | ||||
| @Override | |||||
| public WxMallNoticeContact getNoticeContact(TenantEntity tenantInfo) { | |||||
| return wxMallNoticeContactMapper.getByTenantInfo(tenantInfo); | |||||
| } | |||||
| @Override | |||||
| public void saveNoticeContact(WxMallNoticeContact record) { | |||||
| if(record.getId() == null){ | |||||
| WxMallNoticeContact byTenantInfo = wxMallNoticeContactMapper.getByTenantInfo(record); | |||||
| if(byTenantInfo != null){ | |||||
| record.setId(byTenantInfo.getId()); | |||||
| } | |||||
| } | |||||
| if(record.getId() == null){ | |||||
| wxMallNoticeContactMapper.insert(record); | |||||
| }else{ | |||||
| wxMallNoticeContactMapper.updateById(record); | |||||
| } | |||||
| } | |||||
| } | } | ||||
| @@ -75,7 +75,7 @@ public class WxComposeChildOrderShare { | |||||
| private Long merchantId;//收款商户 | private Long merchantId;//收款商户 | ||||
| private String merchantUid;//收款商户 | private String merchantUid;//收款商户 | ||||
| public void setServiceAmount(Integer serviceAmount){ | |||||
| public void handleServiceAmount(Integer serviceAmount){ | |||||
| if(this.realPayMent == null){ | if(this.realPayMent == null){ | ||||
| return; | return; | ||||
| } | } | ||||
| @@ -145,7 +145,7 @@ public class TtServiceFeeService implements ServiceFeeAdapterService{ | |||||
| //商品设置的总分佣率 | //商品设置的总分佣率 | ||||
| int allCommission = getAllCommission(payAccount,wxComposeChildOrderShare.getOrderId()); | int allCommission = getAllCommission(payAccount,wxComposeChildOrderShare.getOrderId()); | ||||
| int serviceAmount = PayUtils.getPayRate(wxComposeChildOrderShare.getRealPayMent(), allCommission, true); | int serviceAmount = PayUtils.getPayRate(wxComposeChildOrderShare.getRealPayMent(), allCommission, true); | ||||
| wxComposeChildOrderShare.setServiceAmount(serviceAmount); | |||||
| wxComposeChildOrderShare.handleServiceAmount(serviceAmount); | |||||
| return true; | return true; | ||||
| } | } | ||||
| @@ -91,7 +91,7 @@ public class WxServiceFeeService implements ServiceFeeAdapterService{ | |||||
| //商品设置的总分佣率 | //商品设置的总分佣率 | ||||
| int allCommission = getAllCommission(payAccount,wxComposeChildOrderShare.getOrderId()); | int allCommission = getAllCommission(payAccount,wxComposeChildOrderShare.getOrderId()); | ||||
| int serviceAmount = PayUtils.getPayRate(wxComposeChildOrderShare.getRealPayMent(), allCommission, true); | int serviceAmount = PayUtils.getPayRate(wxComposeChildOrderShare.getRealPayMent(), allCommission, true); | ||||
| wxComposeChildOrderShare.setServiceAmount(serviceAmount); | |||||
| wxComposeChildOrderShare.handleServiceAmount(serviceAmount); | |||||
| return true; | return true; | ||||
| } | } | ||||
| @@ -470,7 +470,7 @@ | |||||
| <select id="findSendCouponIds" parameterType="java.util.HashMap" resultType="Long"> | <select id="findSendCouponIds" parameterType="java.util.HashMap" resultType="Long"> | ||||
| select id | select id | ||||
| from wx_coupon | from wx_coupon | ||||
| where c.`version` = 0 and `tenant_id` = #{tenantId} | |||||
| where `version` = 0 and `tenant_id` = #{tenantId} | |||||
| and ((valid_type=1 | and ((valid_type=1 | ||||
| <choose> | <choose> | ||||
| <when test="expired == 0"> | <when test="expired == 0"> | ||||
| @@ -0,0 +1,65 @@ | |||||
| <?xml version="1.0" encoding="UTF-8"?> | |||||
| <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |||||
| <mapper namespace="com.iformall.mapper.WxMallNoticeContactMapper"> | |||||
| <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxMallNoticeContact"> | |||||
| <id column="id" jdbcType="BIGINT" property="id"/> | |||||
| <result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/> | |||||
| <result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId"/> | |||||
| <result column="phone" jdbcType="VARCHAR" property="phone"/> | |||||
| <result column="phone_enabled" jdbcType="INTEGER" property="phoneEnabled"/> | |||||
| <result column="email" jdbcType="VARCHAR" property="email"/> | |||||
| <result column="email_enabled" jdbcType="INTEGER" property="emailEnabled"/> | |||||
| </resultMap> | |||||
| <sql id="allColumns"> | |||||
| `id`,`tenant_id`,`parent_tenant_id`,`phone`,`phone_enabled`,`email`,`email_enabled` | |||||
| </sql> | |||||
| <sql id="dynamicWhereConditions"> | |||||
| where 1 = 1 | |||||
| <if test=" null != id "> | |||||
| and `id` = #{id} | |||||
| </if> | |||||
| <if test=" null != tenantId and '' != tenantId"> | |||||
| and `tenant_id` = #{tenantId} | |||||
| </if> | |||||
| <if test=" null != parentTenantId and '' != parentTenantId"> | |||||
| and `parent_tenant_id` = #{parentTenantId} | |||||
| </if> | |||||
| <if test=" null != ids "> | |||||
| and id in | |||||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | |||||
| #{idItem} | |||||
| </foreach> | |||||
| </if> | |||||
| <if test=" null != sortColumns">order by ${sortColumns}</if> | |||||
| </sql> | |||||
| <select id="findList" parameterType="com.iformall.domain.po.WxMallNoticeContact" resultMap="BaseResultMap"> | |||||
| select | |||||
| <include refid="allColumns"/> | |||||
| from wx_mall_notice_contact | |||||
| <include refid="dynamicWhereConditions"/> | |||||
| </select> | |||||
| <select id="getByTenantId" parameterType="string" resultMap="BaseResultMap"> | |||||
| select | |||||
| <include refid="allColumns"/> | |||||
| from wx_mall_notice_contact | |||||
| where `tenant_id` = #{tenantId} | |||||
| </select> | |||||
| <select id="getByTenantInfo" parameterType="com.iformall.domain.po.base.TenantEntity" resultMap="BaseResultMap"> | |||||
| select | |||||
| <include refid="allColumns"/> | |||||
| from wx_mall_notice_contact | |||||
| where `tenant_id` = #{tenantId} | |||||
| <if test=" null != parentTenantId and '' != parentTenantId"> | |||||
| and `parent_tenant_id` = #{parentTenantId} | |||||
| </if> | |||||
| </select> | |||||
| </mapper> | |||||
| @@ -20,7 +20,7 @@ | |||||
| </if> | </if> | ||||
| <if test=" null != tenantId and '' != tenantId"> | <if test=" null != tenantId and '' != tenantId"> | ||||
| and | |||||
| and `tenant_id` = #{tenantId} | |||||
| </if> | </if> | ||||
| <if test=" null != parentTenantId and '' != parentTenantId"> | <if test=" null != parentTenantId and '' != parentTenantId"> | ||||
| and `parent_tenant_id` = #{parentTenantId} | and `parent_tenant_id` = #{parentTenantId} | ||||