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