添加活动名称和规则类型,并更新相关接口。
This commit is contained in:
parent
69f6da2d54
commit
ebc86a6416
|
|
@ -59,6 +59,7 @@ public class PrizeGoodsRuleController extends BaseController {
|
||||||
info.setCreateUser(tokenMap.get("id") + "");
|
info.setCreateUser(tokenMap.get("id") + "");
|
||||||
info.setCreateTime(DateUtil.getTime());
|
info.setCreateTime(DateUtil.getTime());
|
||||||
info.setCompanyId(tokenMap.get("companyId") + "");
|
info.setCompanyId(tokenMap.get("companyId") + "");
|
||||||
|
params.put("ruleType", info.getRuleType());
|
||||||
if (prizeGoodsRuleService.count(params, ".countRules") > 0) {
|
if (prizeGoodsRuleService.count(params, ".countRules") > 0) {
|
||||||
return AjaxResult.error(ErrorUtils.ERROR, "仅允许一个启用的规则");
|
return AjaxResult.error(ErrorUtils.ERROR, "仅允许一个启用的规则");
|
||||||
}
|
}
|
||||||
|
|
@ -100,6 +101,7 @@ public class PrizeGoodsRuleController extends BaseController {
|
||||||
public Map<String, Object> updateStatus(
|
public Map<String, Object> updateStatus(
|
||||||
@ApiParam(required = true, value = "活动id") @RequestParam(required = true) String id,
|
@ApiParam(required = true, value = "活动id") @RequestParam(required = true) String id,
|
||||||
@ApiParam(required = true, value = "0.停用 1.启用") @RequestParam(required = true) String status,
|
@ApiParam(required = true, value = "0.停用 1.启用") @RequestParam(required = true) String status,
|
||||||
|
@ApiParam(required = false, value = "1.经销商 2.零售商") @RequestParam(required = false) String ruleType,
|
||||||
HttpServletRequest request) {
|
HttpServletRequest request) {
|
||||||
Map<String, Object> params = new HashMap<>();
|
Map<String, Object> params = new HashMap<>();
|
||||||
String token = request.getHeader("token");
|
String token = request.getHeader("token");
|
||||||
|
|
@ -107,9 +109,11 @@ public class PrizeGoodsRuleController extends BaseController {
|
||||||
return AjaxResult.error(ErrorUtils.IS_NOT_LOGIN_ERROR, "用户未登录");
|
return AjaxResult.error(ErrorUtils.IS_NOT_LOGIN_ERROR, "用户未登录");
|
||||||
}
|
}
|
||||||
params.put("id", id);
|
params.put("id", id);
|
||||||
|
params.put("ruleType", ruleType);
|
||||||
if (FINALCMD.NORMAL.equals(status) && prizeGoodsRuleService.count(params, ".countRules") > 0) {
|
if (FINALCMD.NORMAL.equals(status) && prizeGoodsRuleService.count(params, ".countRules") > 0) {
|
||||||
return AjaxResult.error(ErrorUtils.ERROR, "仅允许一个启用的规则");
|
return AjaxResult.error(ErrorUtils.ERROR, "仅允许一个启用的规则");
|
||||||
}
|
}
|
||||||
|
params.remove("ruleType");
|
||||||
params.put("status", status);
|
params.put("status", status);
|
||||||
return toAjax(prizeGoodsRuleService.updateStatus(params, ".updatePrizeGoodsRule"));
|
return toAjax(prizeGoodsRuleService.updateStatus(params, ".updatePrizeGoodsRule"));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@
|
||||||
<!-- 表查询字段 -->
|
<!-- 表查询字段 -->
|
||||||
<sql id="allColumns">
|
<sql id="allColumns">
|
||||||
a.id, a.prize_type, a.dealer_in_prize, a.dealer_out_prize, a.operator_prize, a.create_time,
|
a.id, a.prize_type, a.dealer_in_prize, a.dealer_out_prize, a.operator_prize, a.create_time,
|
||||||
a.create_user, a.company_id, a.status, a.remark, a.start_time, a.end_time
|
a.create_user, a.company_id, a.status, a.remark, a.start_time, a.end_time, a.activity_name, a.rule_type
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<!-- 根据条件参数查询数据列表 -->
|
<!-- 根据条件参数查询数据列表 -->
|
||||||
|
|
@ -40,10 +40,10 @@
|
||||||
AND a.status = #{status}
|
AND a.status = #{status}
|
||||||
</if>
|
</if>
|
||||||
<if test="activityName != null and activityName != ''">
|
<if test="activityName != null and activityName != ''">
|
||||||
AND a.ACTIVITY_NAME like '%' || #{activityName} || '%'
|
AND a.activity_name like '%' || #{activityName} || '%'
|
||||||
</if>
|
</if>
|
||||||
<if test="ruleType != null and ruleType != ''">
|
<if test="ruleType != null and ruleType != ''">
|
||||||
AND a.RULE_TYPE = #{ruleType}
|
AND a.rule_type = #{ruleType}
|
||||||
</if>
|
</if>
|
||||||
ORDER BY a.create_time DESC
|
ORDER BY a.create_time DESC
|
||||||
</select>
|
</select>
|
||||||
|
|
@ -57,7 +57,7 @@
|
||||||
AND prize_type = #{prizeType}
|
AND prize_type = #{prizeType}
|
||||||
</if>
|
</if>
|
||||||
<if test="ruleType != null and ruleType != ''">
|
<if test="ruleType != null and ruleType != ''">
|
||||||
AND RULE_TYPE = #{ruleType}
|
AND rule_type = #{ruleType}
|
||||||
</if>
|
</if>
|
||||||
<if test="companyId != null and companyId != ''">
|
<if test="companyId != null and companyId != ''">
|
||||||
AND company_id = #{companyId}
|
AND company_id = #{companyId}
|
||||||
|
|
@ -66,25 +66,23 @@
|
||||||
|
|
||||||
<!-- 插入数据 -->
|
<!-- 插入数据 -->
|
||||||
<insert id="insertPrizeGoodsRule" parameterType="map">
|
<insert id="insertPrizeGoodsRule" parameterType="map">
|
||||||
INSERT INTO crm_prize_goods_rule (
|
INSERT INTO crm_prize_goods_rule (id, prize_type, dealer_in_prize, dealer_out_prize, operator_prize,
|
||||||
id, prize_type, dealer_in_prize, dealer_out_prize, operator_prize, create_time, create_user,
|
create_time, create_user,
|
||||||
company_id, status, remark, start_time, end_time,ACTIVITY_NAME,RULE_TYPE
|
company_id, status, remark, start_time, end_time, activity_name, rule_type)
|
||||||
) VALUES (
|
VALUES (#{id,jdbcType=VARCHAR},
|
||||||
#{id,jdbcType=VARCHAR},
|
#{prizeType,jdbcType=VARCHAR},
|
||||||
#{prizeType,jdbcType=VARCHAR},
|
#{dealerInPrize,jdbcType=DECIMAL},
|
||||||
#{dealerInPrize,jdbcType=DECIMAL},
|
#{dealerOutPrize,jdbcType=DECIMAL},
|
||||||
#{dealerOutPrize,jdbcType=DECIMAL},
|
#{operatorPrize,jdbcType=DECIMAL},
|
||||||
#{operatorPrize,jdbcType=DECIMAL},
|
#{createTime,jdbcType=VARCHAR},
|
||||||
#{createTime,jdbcType=VARCHAR},
|
#{createUser,jdbcType=VARCHAR},
|
||||||
#{createUser,jdbcType=VARCHAR},
|
#{companyId,jdbcType=VARCHAR},
|
||||||
#{companyId,jdbcType=VARCHAR},
|
#{status,jdbcType=VARCHAR},
|
||||||
#{status,jdbcType=VARCHAR},
|
#{remark,jdbcType=VARCHAR},
|
||||||
#{remark,jdbcType=VARCHAR},
|
#{startTime,jdbcType=VARCHAR},
|
||||||
#{startTime,jdbcType=VARCHAR},
|
#{endTime,jdbcType=VARCHAR},
|
||||||
#{endTime,jdbcType=VARCHAR},
|
#{activityName,jdbcType=VARCHAR},
|
||||||
#{activityName,jdbcType=VARCHAR},
|
#{ruleType,jdbcType=VARCHAR})
|
||||||
#{ruleType,jdbcType=VARCHAR}
|
|
||||||
)
|
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
<!-- 修改数据 -->
|
<!-- 修改数据 -->
|
||||||
|
|
@ -116,10 +114,10 @@
|
||||||
end_time = #{endTime,jdbcType=VARCHAR},
|
end_time = #{endTime,jdbcType=VARCHAR},
|
||||||
</if>
|
</if>
|
||||||
<if test="activityName != null">
|
<if test="activityName != null">
|
||||||
ACTIVITY_NAME = #{activityName,jdbcType=VARCHAR},
|
activity_name = #{activityName,jdbcType=VARCHAR},
|
||||||
</if>
|
</if>
|
||||||
<if test="ruleType != null">
|
<if test="ruleType != null">
|
||||||
RULE_TYPE = #{ruleType,jdbcType=VARCHAR},
|
rule_type = #{ruleType,jdbcType=VARCHAR},
|
||||||
</if>
|
</if>
|
||||||
</set>
|
</set>
|
||||||
WHERE id = #{id}
|
WHERE id = #{id}
|
||||||
|
|
|
||||||
|
|
@ -33,40 +33,42 @@
|
||||||
AND a.status = #{status}
|
AND a.status = #{status}
|
||||||
</if>
|
</if>
|
||||||
<if test="activityName != null and activityName != ''">
|
<if test="activityName != null and activityName != ''">
|
||||||
AND a.ACTIVITY_NAME like '%' || #{activityName} || '%'
|
AND a.activity_name like '%' || #{activityName} || '%'
|
||||||
</if>
|
</if>
|
||||||
<if test="ruleType != null and ruleType != ''">
|
<if test="ruleType != null and ruleType != ''">
|
||||||
AND a.RULE_TYPE = #{ruleType}
|
AND a.rule_type = #{ruleType}
|
||||||
</if>
|
</if>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<!-- 插入数据 -->
|
<!-- 插入数据 -->
|
||||||
<insert id="insertRulesText" parameterType="map">
|
<insert id="insertRulesText" parameterType="map">
|
||||||
INSERT INTO crm_prize_goods_text (
|
INSERT INTO crm_prize_goods_text (
|
||||||
id, prize_type, rule_id, status, text, create_time
|
id, prize_type, rule_id, status, text, create_time, activity_name, rule_type
|
||||||
) VALUES (
|
) VALUES (
|
||||||
#{id,jdbcType=VARCHAR},
|
#{id,jdbcType=VARCHAR},
|
||||||
#{prizeType,jdbcType=VARCHAR},
|
#{prizeType,jdbcType=VARCHAR},
|
||||||
#{ruleId,jdbcType=VARCHAR},
|
#{ruleId,jdbcType=VARCHAR},
|
||||||
#{status,jdbcType=VARCHAR},
|
#{status,jdbcType=VARCHAR},
|
||||||
#{text,jdbcType=VARCHAR},
|
#{text,jdbcType=VARCHAR},
|
||||||
#{createTime,jdbcType=VARCHAR}
|
#{createTime,jdbcType=VARCHAR},
|
||||||
|
#{activityName,jdbcType=VARCHAR},
|
||||||
|
#{ruleType,jdbcType=VARCHAR}
|
||||||
)
|
)
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
<!-- 批量插入数据 -->
|
<!-- 批量插入数据 -->
|
||||||
<insert id="insertRulesTexts" parameterType="list">
|
<insert id="insertRulesTexts" parameterType="list">
|
||||||
INSERT INTO crm_prize_goods_text (
|
INSERT INTO crm_prize_goods_text (
|
||||||
id, prize_type, rule_id, status, text, create_time,ACTIVITY_NAME,RULE_TYPE
|
id, prize_type, rule_id, status, text, create_time, activity_name, rule_type
|
||||||
)
|
)
|
||||||
<foreach collection="list" index="index" item="item" separator="UNION ALL">
|
<foreach collection="list" index="index" item="item" separator="UNION ALL">
|
||||||
SELECT
|
SELECT
|
||||||
#{item.id,jdbcType=VARCHAR},
|
#{item.id,jdbcType=VARCHAR},
|
||||||
#{item.prizeType,jdbcType=VARCHAR},
|
#{item.prizeType,jdbcType=VARCHAR},
|
||||||
#{item.ruleId,jdbcType=VARCHAR},
|
#{item.ruleId,jdbcType=VARCHAR},
|
||||||
#{item.status,jdbcType=VARCHAR},
|
#{item.status,jdbcType=VARCHAR},
|
||||||
#{item.text,jdbcType=VARCHAR},
|
#{item.text,jdbcType=VARCHAR},
|
||||||
#{item.createTime,jdbcType=VARCHAR},
|
#{item.createTime,jdbcType=VARCHAR},
|
||||||
#{item.activityName,jdbcType=VARCHAR},
|
#{item.activityName,jdbcType=VARCHAR},
|
||||||
#{item.ruleType,jdbcType=VARCHAR}
|
#{item.ruleType,jdbcType=VARCHAR}
|
||||||
FROM DUAL
|
FROM DUAL
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,7 @@
|
||||||
<result column="create_time" property="createTime" jdbcType="VARCHAR" />
|
<result column="create_time" property="createTime" jdbcType="VARCHAR" />
|
||||||
<result column="create_user" property="createUser" jdbcType="VARCHAR" />
|
<result column="create_user" property="createUser" jdbcType="VARCHAR" />
|
||||||
<result column="remark" property="remark" jdbcType="VARCHAR" />
|
<result column="remark" property="remark" jdbcType="VARCHAR" />
|
||||||
|
<result column="activity_name" property="activityName" jdbcType="VARCHAR" />
|
||||||
<result column="nick_name" property="createName" jdbcType="VARCHAR" />
|
<result column="nick_name" property="createName" jdbcType="VARCHAR" />
|
||||||
<result column="distributor_name" property="clientName" jdbcType="VARCHAR" />
|
<result column="distributor_name" property="clientName" jdbcType="VARCHAR" />
|
||||||
<result column="staffName" property="staffName" jdbcType="VARCHAR" />
|
<result column="staffName" property="staffName" jdbcType="VARCHAR" />
|
||||||
|
|
@ -29,15 +30,15 @@
|
||||||
<!-- 表查询字段 -->
|
<!-- 表查询字段 -->
|
||||||
<sql id="allColumns">
|
<sql id="allColumns">
|
||||||
a.id, a.division_mode, a.min_amount, a.max_amount, a.rp_num, a.used_num, a.rp_amount, a.start_time,
|
a.id, a.division_mode, a.min_amount, a.max_amount, a.rp_num, a.used_num, a.rp_amount, a.start_time,
|
||||||
a.end_time, a.status, a.client_id, a.staff_id, a.company_id, a.create_time, a.create_user, a.remark
|
a.end_time, a.status, a.client_id, a.staff_id, a.company_id, a.create_time, a.create_user, a.remark, a.activity_name
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<!-- 根据条件参数查询会议红包活动规则表列表 -->
|
<!-- 根据条件参数查询会议红包活动规则表列表 -->
|
||||||
<select id="findCrmPrizeMeetingRuleByCondition" resultMap="crmPrizeMeetingRuleMap" parameterType="map">
|
<select id="findCrmPrizeMeetingRuleByCondition" resultMap="crmPrizeMeetingRuleMap" parameterType="map">
|
||||||
SELECT
|
SELECT
|
||||||
a.id, a.division_mode, a.min_amount, a.max_amount, a.rp_num, a.used_num, a.rp_amount, a.start_time, a.end_time,
|
a.id, a.division_mode, a.min_amount, a.max_amount, a.rp_num, a.used_num, a.rp_amount, a.start_time, a.end_time,
|
||||||
a.status, a.client_id, a.staff_id, a.company_id, a.create_time, a.create_user, a.remark, b.nick_name,
|
a.status, a.client_id, a.staff_id, a.company_id, a.create_time, a.create_user, a.remark, a.activity_name,
|
||||||
c.distributor_name, d.name staffName
|
b.nick_name, c.distributor_name, d.name staffName
|
||||||
FROM crm_prize_meeting_rule a
|
FROM crm_prize_meeting_rule a
|
||||||
left join crm_user b on a.create_user = b.id
|
left join crm_user b on a.create_user = b.id
|
||||||
left join crm_distributor_user_info c on a.client_id = c.id
|
left join crm_distributor_user_info c on a.client_id = c.id
|
||||||
|
|
@ -73,7 +74,7 @@
|
||||||
TO_CHAR(TO_DATE(SUBSTR(#{endDate},1,10),'yyyy-MM-dd'),'yyyy-MM-dd')
|
TO_CHAR(TO_DATE(SUBSTR(#{endDate},1,10),'yyyy-MM-dd'),'yyyy-MM-dd')
|
||||||
</if>
|
</if>
|
||||||
<if test="activityName != null and activityName != ''">
|
<if test="activityName != null and activityName != ''">
|
||||||
AND a.ACTIVITY_NAME like '%' || #{activityName} || '%'
|
AND a.activity_name like '%' || #{activityName} || '%'
|
||||||
</if>
|
</if>
|
||||||
</where>
|
</where>
|
||||||
ORDER BY a.create_time DESC
|
ORDER BY a.create_time DESC
|
||||||
|
|
@ -81,28 +82,27 @@
|
||||||
|
|
||||||
<!-- 新增会议红包活动规则表信息 -->
|
<!-- 新增会议红包活动规则表信息 -->
|
||||||
<insert id="addCrmPrizeMeetingRule">
|
<insert id="addCrmPrizeMeetingRule">
|
||||||
INSERT INTO crm_prize_meeting_rule (
|
INSERT INTO crm_prize_meeting_rule (id, division_mode, min_amount, max_amount, rp_num, used_num, rp_amount,
|
||||||
id, division_mode, min_amount, max_amount, rp_num, used_num, rp_amount, start_time,
|
start_time,
|
||||||
end_time, status, client_id, staff_id, company_id, create_time, create_user, remark,ACTIVITY_NAME
|
end_time, status, client_id, staff_id, company_id, create_time, create_user,
|
||||||
) VALUES (
|
remark, activity_name)
|
||||||
#{id,jdbcType=VARCHAR},
|
VALUES (#{id,jdbcType=VARCHAR},
|
||||||
#{divisionMode,jdbcType=VARCHAR},
|
#{divisionMode,jdbcType=VARCHAR},
|
||||||
#{minAmount,jdbcType=DECIMAL},
|
#{minAmount,jdbcType=DECIMAL},
|
||||||
#{maxAmount,jdbcType=DECIMAL},
|
#{maxAmount,jdbcType=DECIMAL},
|
||||||
#{rpNum,jdbcType=INTEGER},
|
#{rpNum,jdbcType=INTEGER},
|
||||||
0,
|
0,
|
||||||
#{rpAmount,jdbcType=DECIMAL},
|
#{rpAmount,jdbcType=DECIMAL},
|
||||||
#{startTime,jdbcType=VARCHAR},
|
#{startTime,jdbcType=VARCHAR},
|
||||||
#{endTime,jdbcType=VARCHAR},
|
#{endTime,jdbcType=VARCHAR},
|
||||||
#{status,jdbcType=VARCHAR},
|
#{status,jdbcType=VARCHAR},
|
||||||
#{clientId,jdbcType=VARCHAR},
|
#{clientId,jdbcType=VARCHAR},
|
||||||
#{staffId,jdbcType=VARCHAR},
|
#{staffId,jdbcType=VARCHAR},
|
||||||
#{companyId,jdbcType=VARCHAR},
|
#{companyId,jdbcType=VARCHAR},
|
||||||
#{createTime,jdbcType=VARCHAR},
|
#{createTime,jdbcType=VARCHAR},
|
||||||
#{createUser,jdbcType=VARCHAR},
|
#{createUser,jdbcType=VARCHAR},
|
||||||
#{remark,jdbcType=VARCHAR},
|
#{remark,jdbcType=VARCHAR},
|
||||||
#{activityName,jdbcType=VARCHAR}
|
#{activityName,jdbcType=VARCHAR})
|
||||||
)
|
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
<!-- 修改会议红包活动规则表信息 -->
|
<!-- 修改会议红包活动规则表信息 -->
|
||||||
|
|
@ -146,7 +146,7 @@
|
||||||
remark = #{remark,jdbcType=VARCHAR},
|
remark = #{remark,jdbcType=VARCHAR},
|
||||||
</if>
|
</if>
|
||||||
<if test="activityName != null">
|
<if test="activityName != null">
|
||||||
ACTIVITY_NAME = #{activityName,jdbcType=VARCHAR},
|
activity_name = #{activityName,jdbcType=VARCHAR},
|
||||||
</if>
|
</if>
|
||||||
</set>
|
</set>
|
||||||
WHERE id = #{id}
|
WHERE id = #{id}
|
||||||
|
|
|
||||||
|
|
@ -69,6 +69,8 @@ public class PrizeGoodsRuleService {
|
||||||
rulesText.setRuleId(info.getId());
|
rulesText.setRuleId(info.getId());
|
||||||
rulesText.setPrizeType(info.getPrizeType());
|
rulesText.setPrizeType(info.getPrizeType());
|
||||||
rulesText.setStatus(info.getStatus());
|
rulesText.setStatus(info.getStatus());
|
||||||
|
rulesText.setRuleType(info.getRuleType());
|
||||||
|
rulesText.setActivityName(info.getActivityName());
|
||||||
rulesText.setCreateTime(info.getCreateTime());
|
rulesText.setCreateTime(info.getCreateTime());
|
||||||
}
|
}
|
||||||
detailDao.add_obj(CrmPrizeGoodsText.class.getName() + ".insertRulesTexts", textList);
|
detailDao.add_obj(CrmPrizeGoodsText.class.getName() + ".insertRulesTexts", textList);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue