Parcourir la source

添加 骄阳 达人列表 添加解綁 删除接口

zhaoxian il y a 2 ans
Parent
commit
d41737ff82

+ 11 - 1
ruixuan-live/src/main/java/com/ruixuan/isc/controller/KuaishouPromoterController.java

@@ -276,7 +276,7 @@ public class KuaishouPromoterController extends BaseController {
      * 修改骄阳达人 信息
      */
     @PostMapping(value = "/edit3")
-    @ApiOperation(value = "修改快手达人")
+    @ApiOperation(value = "修改骄阳达人")
     public AjaxResult edit3(@RequestBody JYKuaishouPromoter kuaishouPromoter) {
         return toAjax(kuaishouPromoterService.updateKuaishouPromoter3(kuaishouPromoter));
     }
@@ -300,6 +300,16 @@ public class KuaishouPromoterController extends BaseController {
         return kuaishouPromoterService.deleteKuaishouPromoterById(id, userId);
     }
 
+    /**
+     * 删除骄阳达人 信息
+     */
+    @GetMapping("/deleteById3")
+    @ApiOperation(value = "删除骄阳达人")
+    public Result deleteById3(@ApiParam("主键") @RequestParam(value = "id", required = true) Long id,
+                              @ApiParam("操作人ID") @RequestParam(value = "userId", required = true) Long userId) {
+        return kuaishouPromoterService.deleteKuaishouPromoterById3(id, userId);
+    }
+
 
     /**
      * 读取图片文字信息

+ 4 - 0
ruixuan-live/src/main/java/com/ruixuan/isc/mapper/KuaishouPromoterMapper.java

@@ -119,4 +119,8 @@ public interface KuaishouPromoterMapper {
     void updateKuaishouPromoterByPromoterId3(JYKuaishouPromoter kuaishouPromoter);
 
     int updateKuaishouPromoter3(JYKuaishouPromoter kuaishouPromoter);
+
+    JYKuaishouPromoter selectKuaishouPromoterById3(Long id);
+
+    void deleteKuaishouPromoterById3(Long id);
 }

+ 2 - 0
ruixuan-live/src/main/java/com/ruixuan/isc/service/IKuaishouPromoterService.java

@@ -90,4 +90,6 @@ public interface IKuaishouPromoterService {
     JSONObject insertKuaishouPromoter3(JYKuaishouPromoter kuaishouPromoter);
 
     int updateKuaishouPromoter3(JYKuaishouPromoter kuaishouPromoter);
+
+    Result deleteKuaishouPromoterById3(Long id, Long userId);
 }

+ 27 - 0
ruixuan-live/src/main/java/com/ruixuan/isc/service/impl/KuaishouPromoterServiceImpl.java

@@ -584,6 +584,33 @@ public class KuaishouPromoterServiceImpl implements IKuaishouPromoterService {
         return Result.success();
     }
 
+    /**
+     * 删除快手达人 信息信息
+     *
+     * @param id 快手达人 信息主键 follow_up_records
+     * @return 结果
+     */
+    @Override
+    public Result deleteKuaishouPromoterById3(Long id, Long userId) {
+        JYKuaishouPromoter promoter = kuaishouPromoterMapper.selectKuaishouPromoterById3(id);
+
+        if (Check.isNotNull(promoter)) {
+            JSONObject record = new JSONObject();
+            record.put("promoterId", promoter.getPromoterId());
+            record.put("userId", promoter.getUserId());
+            record.put("operatorId", userId);
+            List<JSONObject> roles = sysUserService.getUserRoleByUserId(userId);
+            if (Check.isNotNull(roles)) {
+                record.put("roleName", roles.get(0).getString("role_name") + " (解绑骄阳)");
+                record.put("roleKey", roles.get(0).getString("role_key"));
+            }
+
+            kuaishouPromoterMapper.insertKuaishouPromoterRecord(record);
+        }
+        kuaishouPromoterMapper.deleteKuaishouPromoterById3(id);
+        return Result.success();
+    }
+
     @Override
     public AjaxResult getPromoterInfo(String promoterId) {
         AjaxResult ajaxResult = null;

+ 31 - 0
ruixuan-live/src/main/resources/mapper/isc/KuaishouPromoterMapper.xml

@@ -274,6 +274,31 @@
         where id = #{id}
     </select>
 
+    <select id="selectKuaishouPromoterById3" parameterType="Long" resultMap="KuaishouPromoterResult">
+        select id,
+               media_id,
+               user_id,
+               user_name,
+               promoter_id,
+               promoter_nick_name,
+               `state`,
+               province,
+               commission_requirement,
+               category_requirement,
+               promoter_url,
+               phone,
+               consignee,
+               promoter_address,
+               total_sale,
+               fans_number,
+               avg_video_sales,
+               video_sales,
+               create_time,
+               update_time
+        from jy_kuaishou_promoter
+        where id = #{id}
+    </select>
+
     <select id="getFailInfo" resultMap="KuaishouPromoterResult">
         <include refid="selectKuaishouPromoterVo"/>
         where (promoter_nick_name = '' or promoter_nick_name is null)
@@ -623,6 +648,12 @@
         where id = #{id}
     </delete>
 
+    <delete id="deleteKuaishouPromoterById3" parameterType="Long">
+        delete
+        from jy_kuaishou_promoter
+        where id = #{id}
+    </delete>
+
     <delete id="deleteKuaishouPromoterByIds" parameterType="String">
         delete from kuaishou_promoter where id in
         <foreach item="id" collection="array" open="(" separator="," close=")">