yumeng 11 maanden geleden
bovenliggende
commit
23b1819d88

+ 84 - 8
ruixuan-live/src/main/java/com/ruixuan/isc/controller/KwaixiaodianItemGetController.java

@@ -62,6 +62,22 @@ public class KwaixiaodianItemGetController extends BaseController {
     @Autowired
     private ISysUserService sysUserService;
 
+
+
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return AjaxResult.success(kwaixiaodianItemGetService.selectKwaixiaodianItemGetById(id));
+    }
+
+
+
+    @PutMapping
+    public AjaxResult edit(@RequestBody KwaixiaodianItemGet kwaixiaodianItemGet)
+    {
+        return toAjax(kwaixiaodianItemGetService.updateKwaixiaodianItemGet(kwaixiaodianItemGet));
+    }
+
     @GetMapping("/list")
     public TableDataInfo list(Long itemId, String title, Integer itemType, Long userId) {
         TableDataInfo rspData = new TableDataInfo();
@@ -144,6 +160,30 @@ public class KwaixiaodianItemGetController extends BaseController {
         return returnJson;
     }
 
+    @GetMapping("/getCourtshipPurchaseIds")
+    public JSONObject getCourtshipPurchaseIds(Long userId) {
+
+        JSONObject returnJson = new JSONObject();
+        try {
+            if (Check.isNull(userId)) {
+                throw new Exception("请传入用户ID");
+            }
+            Long companyId = kwaixiaodianItemGetService.getCompanyId(userId);
+
+            List<JSONObject> userIds = kwaixiaodianItemGetService.getCourtshipPurchaseIds(companyId);
+            returnJson.put("code", 200);
+            returnJson.put("success", true);
+            returnJson.put("data", userIds);
+
+        } catch (Exception e) {
+            e.printStackTrace();
+            returnJson.put("code", 500);
+            returnJson.put("success", false);
+            returnJson.put("message", e.getMessage());
+        }
+        return returnJson;
+    }
+
 
     /**
      * 获取商品详情(open.item.get)
@@ -172,6 +212,10 @@ public class KwaixiaodianItemGetController extends BaseController {
             if (Check.isNull(itemType)) {
                 throw new Exception("未选择选品方式");
             }
+
+            Long courtshipPurchaseId = requestJson.getLong("courtshipPurchaseId");
+
+
             SysUser sysUser = sysUserService.selectUserById(userId);
             if (Check.isNull(sysUser)) {
                 throw new Exception("用户信息为空");
@@ -180,13 +224,15 @@ public class KwaixiaodianItemGetController extends BaseController {
             if (Check.isNull(token)) {
                 throw new Exception("未获取到授权信息,请联系管理员");
             }
+
+
             Long companyId = token.getCompanyId();
             Integer count = kwaixiaodianItemGetService.checkItem(companyId, itemId);
             if (count >= 1) {
                 throw new Exception("此商品已绑定");
             }
 
-            JSONObject jsonObject = kwaixiaodianItemGetService.querykwaiItmInfo(token, itemId, shopId, userId, sysUser.getNickName(), itemType);
+            JSONObject jsonObject = kwaixiaodianItemGetService.querykwaiItmInfo(token, itemId, shopId, userId, sysUser.getNickName(), itemType, courtshipPurchaseId);
             if (jsonObject.getBoolean("success")) {
                 returnJson.put("code", 200);
                 returnJson.put("success", true);
@@ -214,7 +260,7 @@ public class KwaixiaodianItemGetController extends BaseController {
 
 
     @GetMapping("/queryItemReport")
-    public TableDataInfo getDingPanMentorBusinessList(Long userId, String startDate, String endDate, String shopId, Long itemId, String itemTitle) {
+    public TableDataInfo getDingPanMentorBusinessList(Long userId, String startDate, String endDate, String shopId, Long itemId, String itemTitle, Integer itemType) {
 
         TableDataInfo rspData = new TableDataInfo();
         try {
@@ -238,16 +284,26 @@ public class KwaixiaodianItemGetController extends BaseController {
                     throw new Exception("此用户未查询到归属公司");
                 }
                 requestMap.put("companyId", companyId);
-            } else if ("industry_sale_manager".equals(roleId) || "industry_courtship_manager".equals(roleId) || "industry_purchase_manager".equals(roleId)) { // 经理角色查看部门下所有成员数据
+            } else if ("industry_sale_manager".equals(roleId)) { // 销售经理角色查看部门下所有成员数据
                 List<Long> userIds = kwaixiaodianItemGetService.getUserIds(userId);
                 if (Check.isNull(userIds)) {
                     throw new Exception("此用户未查询到部门成员信息");
                 }
                 requestMap.put("userIds", userIds);
-            } else if ("industry_sale".equals(roleId) || "industry_purchase".equals(roleId) || "industry_courtship".equals(roleId)) { // 销售  采购 招商 查看自己的数据
+            } else if ("industry_sale".equals(roleId)) { // 销售   查看自己的数据
                 List<Long> userIds = new ArrayList<>();
                 userIds.add(userId);
                 requestMap.put("userIds", userIds);
+            } else if ("industry_courtship_manager".equals(roleId) || "industry_purchase_manager".equals(roleId)) { // 招商、采购经理角色查看部门下所有成员数据
+                List<Long> courtshipPurchaseIds = kwaixiaodianItemGetService.getUserIds(userId);
+                if (Check.isNull(courtshipPurchaseIds)) {
+                    throw new Exception("此用户未查询到部门成员信息");
+                }
+                requestMap.put("courtshipPurchaseIds", courtshipPurchaseIds);
+            } else if ("industry_purchase".equals(roleId) || "industry_courtship".equals(roleId)) { // 采购 招商 查看自己的数据
+                List<Long> courtshipPurchaseIds = new ArrayList<>();
+                courtshipPurchaseIds.add(userId);
+                requestMap.put("courtshipPurchaseIds", courtshipPurchaseIds);
             }
 
             if (!Check.isNull(shopId)) {
@@ -262,6 +318,10 @@ public class KwaixiaodianItemGetController extends BaseController {
                 requestMap.put("itemTitle", itemTitle);
             }
 
+            if (!Check.isNull(itemType)) {
+                requestMap.put("itemType", itemType);
+            }
+
 
             Long start = DateUtils.strDateToInt(startDate);
             Long end = DateUtils.strDateToInt(endDate);
@@ -294,7 +354,7 @@ public class KwaixiaodianItemGetController extends BaseController {
 
 
     @GetMapping("/exportItemReport")
-    public void exportItemReport(HttpServletRequest request, HttpServletResponse response, Long userId, String startDate, String endDate, String shopId, Long itemId, String itemTitle) throws IOException, ParseException {
+    public void exportItemReport(HttpServletRequest request, HttpServletResponse response, Long userId, String startDate, String endDate, String shopId, Long itemId, String itemTitle, Integer itemType) throws IOException, ParseException {
         Map<String, Object> requestMap = new HashMap<>();
 
         if (Check.isNull(userId)) {
@@ -316,16 +376,26 @@ public class KwaixiaodianItemGetController extends BaseController {
                 return;
             }
             requestMap.put("companyId", companyId);
-        } else if ("industry_sale_manager".equals(roleId) || "industry_courtship_manager".equals(roleId) || "industry_purchase_manager".equals(roleId)) { // 经理角色查看部门下所有成员数据
+        } else if ("industry_sale_manager".equals(roleId)) { // 销售经理角色查看部门下所有成员数据
             List<Long> userIds = kwaixiaodianItemGetService.getUserIds(userId);
             if (Check.isNull(userIds)) {
                 return;
             }
             requestMap.put("userIds", userIds);
-        } else if ("industry_sale".equals(roleId) || "industry_purchase".equals(roleId) || "industry_courtship".equals(roleId)) { // 销售  采购 招商 查看自己的数据
+        } else if ("industry_sale".equals(roleId)) { // 销售   查看自己的数据
             List<Long> userIds = new ArrayList<>();
             userIds.add(userId);
             requestMap.put("userIds", userIds);
+        } else if ("industry_courtship_manager".equals(roleId) || "industry_purchase_manager".equals(roleId)) { // 招商、采购经理角色查看部门下所有成员数据
+            List<Long> courtshipPurchaseIds = kwaixiaodianItemGetService.getUserIds(userId);
+            if (Check.isNull(courtshipPurchaseIds)) {
+                return;
+            }
+            requestMap.put("courtshipPurchaseIds", courtshipPurchaseIds);
+        } else if ("industry_purchase".equals(roleId) || "industry_courtship".equals(roleId)) { // 采购 招商 查看自己的数据
+            List<Long> courtshipPurchaseIds = new ArrayList<>();
+            courtshipPurchaseIds.add(userId);
+            requestMap.put("courtshipPurchaseIds", courtshipPurchaseIds);
         }
 
         if (!Check.isNull(shopId)) {
@@ -338,6 +408,9 @@ public class KwaixiaodianItemGetController extends BaseController {
         if (!Check.isNull(itemTitle)) {
             requestMap.put("itemTitle", itemTitle);
         }
+        if (!Check.isNull(itemType)) {
+            requestMap.put("itemType", itemType);
+        }
 
         Long start = DateUtils.strDateToInt(startDate);
         Long end = DateUtils.strDateToInt(endDate);
@@ -363,10 +436,12 @@ public class KwaixiaodianItemGetController extends BaseController {
                 export.add(data.getString("itemId"));
                 export.add(data.getString("itemTitle"));
                 export.add(data.getString("price"));
+                export.add(data.getString("itemType"));
                 export.add(data.getString("orderNum"));
                 export.add(data.getString("orderNumRate"));
                 export.add(data.getString("validOrderNum"));
                 export.add(data.getString("validRadio"));
+                export.add(data.getString("effOrderNum"));
                 export.add(data.getString("totalFee"));
                 export.add(data.getString("validTotalFee"));
                 export.add(data.getString("deliveryNum"));
@@ -374,11 +449,12 @@ public class KwaixiaodianItemGetController extends BaseController {
                 export.add(data.getString("notDeliveryNum"));
                 export.add(data.getString("expressFee"));
                 export.add(data.getString("userName"));
+                export.add(data.getString("courtshipPurchaseName"));
                 export.add(data.getString("itemPicUrl"));
                 exportList.add(export);
             }
         }
-        String[] headers = {"商品ID", "商品标题", "商品价格", "单量", "单量环比", "有效单量", "有效率", "GVM", "有效GMV", "发货数", "发货率", "未发货数", "运费", "绑定人", "商品图片"};
+        String[] headers = {"商品ID", "商品标题", "商品价格", "类型", "单量", "单量环比", "有效单量", "有效率", "失效单量", "GVM", "有效GMV", "发货数", "发货率", "未发货数", "运费", "绑定人", "招商/采购", "商品图片"};
         OutputStream os = response.getOutputStream();
         ExportExcelUtils eeu = new ExportExcelUtils();
         XSSFWorkbook workbook = new XSSFWorkbook();

+ 3 - 0
ruixuan-live/src/main/java/com/ruixuan/isc/entity/KwaixiaodianItemGet.java

@@ -23,11 +23,14 @@ public class KwaixiaodianItemGet {
      * 用户ID
      */
     private Long userId;
+    private Long courtshipPurchaseId;
 
     /**
      * 用户名称
      */
     private String userName;
+    private String courtshipPurchaseName;
+
 
     /**
      * 店铺id

+ 8 - 0
ruixuan-live/src/main/java/com/ruixuan/isc/mapper/KwaixiaodianItemGetMapper.java

@@ -28,4 +28,12 @@ public interface KwaixiaodianItemGetMapper {
     List<JSONObject> getShopList(@Param("companyId") Long companyId);
 
     int deleteById(Long[] ids);
+
+    List<Long> getDeptIds(@Param("companyId") String companyId);
+
+    List<JSONObject> getCourtshipPurchaseIds(@Param("ids") List<Long> ids);
+
+    KwaixiaodianItemGet selectKwaixiaodianItemGetById(@Param("id") Long id);
+
+    int updateKwaixiaodianItemGet(KwaixiaodianItemGet kwaixiaodianItemGet);
 }

+ 7 - 2
ruixuan-live/src/main/java/com/ruixuan/isc/service/IKwaixiaodianItemGetService.java

@@ -16,12 +16,11 @@ import java.util.Map;
  * @date 2024-10-28
  */
 public interface IKwaixiaodianItemGetService {
-    JSONObject querykwaiItmInfo(KuaishouAccessToken token, Long kwaiItemId, String shopId, Long userId, String userName, Integer itemType);
+    JSONObject querykwaiItmInfo(KuaishouAccessToken token, Long kwaiItemId, String shopId, Long userId, String userName, Integer itemType, Long courtshipPurchaseId);
 
     Integer checkItem(Long companyId, Long itemId);
 
 
-
     Long getCompanyId(Long userId);
 
     List<Long> getUserIds(Long userId);
@@ -31,4 +30,10 @@ public interface IKwaixiaodianItemGetService {
     List<JSONObject> getShopList(Long companyId);
 
     int deleteById(Long[] ids);
+
+    List<JSONObject> getCourtshipPurchaseIds(Long companyId);
+
+    KwaixiaodianItemGet selectKwaixiaodianItemGetById(Long id);
+
+    int updateKwaixiaodianItemGet(KwaixiaodianItemGet kwaixiaodianItemGet);
 }

+ 39 - 2
ruixuan-live/src/main/java/com/ruixuan/isc/service/impl/KwaixiaodianItemGetServiceImpl.java

@@ -20,6 +20,7 @@ import com.ruixuan.isc.service.IKwaixiaodianItemGetService;
 import com.ruixuan.system.service.ISysDeptService;
 import com.ruixuan.system.service.ISysUserService;
 import lombok.extern.slf4j.Slf4j;
+import org.checkerframework.checker.units.qual.C;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
@@ -47,7 +48,7 @@ public class KwaixiaodianItemGetServiceImpl implements IKwaixiaodianItemGetServi
      * 表:kwaixiaodian_item_get
      */
     @Override
-    public JSONObject querykwaiItmInfo(KuaishouAccessToken token, Long kwaiItemId, String shopId, Long userId, String userName, Integer itemType) {
+    public JSONObject querykwaiItmInfo(KuaishouAccessToken token, Long kwaiItemId, String shopId, Long userId, String userName, Integer itemType, Long courtshipPurchaseId) {
         JSONObject returnJson = new JSONObject();
         try {
 
@@ -67,6 +68,15 @@ public class KwaixiaodianItemGetServiceImpl implements IKwaixiaodianItemGetServi
             if ("1".equals(code)) {
                 JSONObject data = jsonObject.getJSONObject("data");
                 KwaixiaodianItemGet itemGet = JSONObject.parseObject(data.toJSONString(), KwaixiaodianItemGet.class);
+
+                if (!Check.isNull(courtshipPurchaseId)) {
+                    itemGet.setCourtshipPurchaseId(courtshipPurchaseId);
+                    String courtshipPurchaseName = sysUserService.getUserNameById(courtshipPurchaseId);
+                    if (!Check.isNull(courtshipPurchaseName)) {
+                        itemGet.setCourtshipPurchaseName(courtshipPurchaseName);
+                    }
+                }
+
                 itemGet.setUserId(userId);
                 itemGet.setItemType(itemType);
                 itemGet.setUserName(userName);
@@ -195,7 +205,34 @@ public class KwaixiaodianItemGetServiceImpl implements IKwaixiaodianItemGetServi
 
     @Override
     public int deleteById(Long[] ids) {
-         return  mapper.deleteById(ids);
+        return mapper.deleteById(ids);
+    }
+
+    @Override
+    public List<JSONObject> getCourtshipPurchaseIds(Long companyId) {
+        List<Long> depts = mapper.getDeptIds(String.valueOf(companyId));
+        if (Check.isNull(depts)) {
+            return null;
+        }
+        List<JSONObject> userList = mapper.getCourtshipPurchaseIds(depts);
+        return userList;
+    }
+
+    @Override
+    public KwaixiaodianItemGet selectKwaixiaodianItemGetById(Long id) {
+        return mapper.selectKwaixiaodianItemGetById(id);
+    }
+
+    @Override
+    public int updateKwaixiaodianItemGet(KwaixiaodianItemGet kwaixiaodianItemGet) {
+        if (!Check.isNull(kwaixiaodianItemGet.getCourtshipPurchaseId())) {
+            String userName = sysUserService.getUserNameById(kwaixiaodianItemGet.getCourtshipPurchaseId());
+            if (!Check.isNull(userName)) {
+                kwaixiaodianItemGet.setCourtshipPurchaseName(userName);
+            }
+
+        }
+        return mapper.updateKwaixiaodianItemGet(kwaixiaodianItemGet);
     }
 
 

+ 155 - 1
ruixuan-live/src/main/resources/mapper/isc/KwaixiaodianItemGetMapper.xml

@@ -3,6 +3,65 @@
         PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.ruixuan.isc.mapper.KwaixiaodianItemGetMapper">
+    <sql id="selectKwaixiaodianItemGetVo">
+        SELECT id,
+               company_id,
+               company_name,
+               leader_name,
+               shop_id,
+               shop_name,
+               item_id,
+               item_type,
+               user_id,
+               user_name,
+               courtship_purchase_id,
+               courtship_purchase_name,
+               rel_item_id,
+               category_id,
+               category_name,
+               parent_category_id,
+               parent_category_name,
+               root_category_id,
+               root_category_name,
+               title,
+               details,
+               image_urls,
+               image_url,
+               detail_image_urls,
+               service_rule,
+               audit_status,
+               audit_reason,
+               created_time_ms,
+               created_time,
+               update_time_ms,
+               update_time,
+               on_offline_status,
+               parent_category_list,
+               item_prop_values,
+               express_template_id,
+               purchase_limit,
+               limit_count,
+               price,
+               link_url,
+               time_of_sale,
+               item_remark,
+               duplication_status,
+               duplication_reason,
+               multiple_stock,
+               poi_ids,
+               white_base_image_url,
+               transparent_image_url,
+               short_title,
+               selling_point,
+               instructions,
+               contract_phone,
+               offline_reason,
+               item_qualification,
+               spu_id,
+               data_create_time,
+               data_update_time
+        FROM kwaixiaodian_item_get
+    </sql>
 
     <insert id="replaceBatchKWaixiaodianItems">
         replace into `ruixuan`.kwaixiaodian_item_get(
@@ -119,6 +178,8 @@
         item_type,
         user_id,
         user_name,
+        courtship_purchase_id,
+        courtship_purchase_name,
         shop_id,
         shop_name,
         company_id,
@@ -168,11 +229,13 @@
         price
         )
         VALUES
-            (
+        (
         #{itemGet.itemId},
         #{itemGet.itemType},
         #{itemGet.userId},
         #{itemGet.userName},
+        #{itemGet.courtshipPurchaseId},
+        #{itemGet.courtshipPurchaseName},
         #{itemGet.shopId},
         #{itemGet.shopName},
         #{itemGet.companyId},
@@ -277,6 +340,66 @@
             )
         </foreach>
     </insert>
+    <update id="updateKwaixiaodianItemGet" parameterType="com.ruixuan.isc.entity.KwaixiaodianItemGet">
+        update kwaixiaodian_item_get
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="companyId != null">company_id = #{companyId},</if>
+            <if test="companyName != null">company_name = #{companyName},</if>
+            <if test="leaderName != null">leader_name = #{leaderName},</if>
+            <if test="shopId != null">shop_id = #{shopId},</if>
+            <if test="shopName != null">shop_name = #{shopName},</if>
+            <if test="itemId != null">item_id = #{itemId},</if>
+            <if test="itemType != null">item_type = #{itemType},</if>
+            <if test="userId != null">user_id = #{userId},</if>
+            <if test="userName != null">user_name = #{userName},</if>
+            <if test="courtshipPurchaseId != null">courtship_purchase_id = #{courtshipPurchaseId},</if>
+            <if test="courtshipPurchaseName != null">courtship_purchase_name = #{courtshipPurchaseName},</if>
+            <if test="relItemId != null">rel_item_id = #{relItemId},</if>
+            <if test="categoryId != null">category_id = #{categoryId},</if>
+            <if test="categoryName != null">category_name = #{categoryName},</if>
+            <if test="parentCategoryId != null">parent_category_id = #{parentCategoryId},</if>
+            <if test="parentCategoryName != null">parent_category_name = #{parentCategoryName},</if>
+            <if test="rootCategoryId != null">root_category_id = #{rootCategoryId},</if>
+            <if test="rootCategoryName != null">root_category_name = #{rootCategoryName},</if>
+            <if test="title != null">title = #{title},</if>
+            <if test="details != null">details = #{details},</if>
+            <if test="imageUrls != null">image_urls = #{imageUrls},</if>
+            <if test="imageUrl != null">image_url = #{imageUrl},</if>
+            <if test="detailImageUrls != null">detail_image_urls = #{detailImageUrls},</if>
+            <if test="serviceRule != null">service_rule = #{serviceRule},</if>
+            <if test="auditStatus != null">audit_status = #{auditStatus},</if>
+            <if test="auditReason != null">audit_reason = #{auditReason},</if>
+            <if test="createdTimeMs != null">created_time_ms = #{createdTimeMs},</if>
+            <if test="createdTime != null">created_time = #{createdTime},</if>
+            <if test="updateTimeMs != null">update_time_ms = #{updateTimeMs},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+            <if test="onOfflineStatus != null">on_offline_status = #{onOfflineStatus},</if>
+            <if test="parentCategoryList != null">parent_category_list = #{parentCategoryList},</if>
+            <if test="itemPropValues != null">item_prop_values = #{itemPropValues},</if>
+            <if test="expressTemplateId != null">express_template_id = #{expressTemplateId},</if>
+            <if test="purchaseLimit != null">purchase_limit = #{purchaseLimit},</if>
+            <if test="limitCount != null">limit_count = #{limitCount},</if>
+            <if test="price != null">price = #{price},</if>
+            <if test="linkUrl != null">link_url = #{linkUrl},</if>
+            <if test="timeOfSale != null">time_of_sale = #{timeOfSale},</if>
+            <if test="itemRemark != null">item_remark = #{itemRemark},</if>
+            <if test="duplicationStatus != null">duplication_status = #{duplicationStatus},</if>
+            <if test="duplicationReason != null">duplication_reason = #{duplicationReason},</if>
+            <if test="multipleStock != null">multiple_stock = #{multipleStock},</if>
+            <if test="poiIds != null">poi_ids = #{poiIds},</if>
+            <if test="whiteBaseImageUrl != null">white_base_image_url = #{whiteBaseImageUrl},</if>
+            <if test="transparentImageUrl != null">transparent_image_url = #{transparentImageUrl},</if>
+            <if test="shortTitle != null">short_title = #{shortTitle},</if>
+            <if test="sellingPoint != null">selling_point = #{sellingPoint},</if>
+            <if test="instructions != null">instructions = #{instructions},</if>
+            <if test="contractPhone != null">contract_phone = #{contractPhone},</if>
+            <if test="offlineReason != null">offline_reason = #{offlineReason},</if>
+            <if test="itemQualification != null">item_qualification = #{itemQualification},</if>
+            <if test="spuId != null">spu_id = #{spuId},</if>
+        </trim>
+        where id = #{id}
+
+    </update>
     <delete id="deleteById" parameterType="java.lang.Long">
         DELETE
         FROM kwaixiaodian_item_get
@@ -298,6 +421,8 @@
         t1.price,
         t1.user_id,
         t1.user_name,
+        t1.courtship_purchase_id,
+        t1.courtship_purchase_name,
         t1.shop_id,
         t1.shop_name,
         t1.company_id,
@@ -366,6 +491,13 @@
                 #{item}
             </foreach>
         </if>
+        <if test='courtshipPurchaseIds != null and courtshipPurchaseIds.size() > 0'>
+            AND t1.courtship_purchase_id in
+            <foreach collection="courtshipPurchaseIds" item="item" separator=","
+                     open="(" close=")">
+                #{item}
+            </foreach>
+        </if>
         <if test="itemId != null and itemId != ''">
             and t1.item_id = #{itemId}
         </if>
@@ -389,6 +521,28 @@
         AND shop_status = 1
         ORDER BY create_time DESC
     </select>
+    <select id="getDeptIds" resultType="java.lang.Long" parameterType="java.lang.String">
+        SELECT dept_id
+        FROM sys_dept
+        WHERE substring_index(substring_index(ancestors, ',', 2), ',', -1) = #{companyId}
+    </select>
+    <select id="getCourtshipPurchaseIds" resultType="com.alibaba.fastjson.JSONObject">
+        SELECT user_id as userId,nick_name as 'userName' from sys_user WHERE
+        dept_id in
+        <if test='ids != null and ids.size() > 0'>
+
+            <foreach collection="ids" item="item" separator=","
+                     open="(" close=")">
+                #{item}
+            </foreach>
+        </if>
+
+    </select>
+    <select id="selectKwaixiaodianItemGetById" resultType="com.ruixuan.isc.entity.KwaixiaodianItemGet"
+            parameterType="java.lang.Long">
+        <include refid="selectKwaixiaodianItemGetVo"/>
+        where id = #{id}
+    </select>
 
 
 </mapper>

+ 16 - 2
ruixuan-live/src/main/resources/mapper/isc/KwaixiaodianOrderCursorListMapper.xml

@@ -430,6 +430,15 @@
         select t1.*,
         round((t1.orderNum - t2.orderNum) / t2.orderNum * 100, 2) as 'orderNumRate'
         from (select t2.user_name as 'userName',
+        t2.courtship_purchase_name as 'courtshipPurchaseName',
+        (
+        CASE when t2.item_type = 1
+        then '自选品'
+        when t2.item_type = 2
+        then '推品'
+        else '-'
+        end
+        ) as 'itemType',
         t1.item_id as itemId,
         t1.item_title as 'itemTitle',
         t1.item_pic_url as 'itemPicUrl',
@@ -440,10 +449,12 @@
         end
         ) as price,
         round(sum(t1.total_fee) / 100, 2) as 'totalFee',
-        IFNULL(round(SUM(CASE WHEN t1.status != 80 and t1.status != 10 THEN t1.total_fee ELSE 0 END) / 100, 2), 0) as 'validTotalFee',
+        IFNULL(round(SUM(CASE WHEN t1.status != 80 and t1.status != 10 THEN t1.total_fee ELSE 0 END) / 100, 2), 0) as
+        'validTotalFee',
         count(t1.oid) as 'orderNum',
         IFNULL(SUM(CASE WHEN t1.status != 80 and t1.status != 10 THEN 1 ELSE 0 END), 0) AS 'validOrderNum',
-        round(sum(case when t1.status != 80  and t1.status != 10 then 1 else 0 end) / count(t1.oid) * 100,
+        IFNULL(SUM(CASE WHEN t1.status = 80 THEN 1 ELSE 0 END), 0) AS 'effOrderNum',
+        round(sum(case when t1.status != 80 and t1.status != 10 then 1 else 0 end) / count(t1.oid) * 100,
         2) as 'validRadio',
         sum(case when t1.status >= 40 and t1.status &lt; 80 then 1 else 0 end) as 'deliveryNum',
         round(sum(case when t1.status >= 40 and t1.status &lt; 80 then 1 else 0 end) /
@@ -465,6 +476,9 @@
         <if test='shopId != null and shopId != ""'>
             and t1.shop_id = #{shopId}
         </if>
+        <if test='itemType != null and itemType != ""'>
+            and t2.item_type = #{itemType}
+        </if>
         <if test='userIds != null and userIds.size() > 0'>
             AND t2.user_id in
             <foreach collection="userIds" item="item" separator=","