Merge remote-tracking branch 'origin/dev' into dev

dev_0531
郑皇 5 years ago
commit 83c2afc3aa

@ -213,6 +213,12 @@
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper-spring-boot-starter</artifactId>
<version>1.2.5</version>
<exclusions>
<exclusion>
<artifactId>mybatis-spring-boot-starter</artifactId>
<groupId>org.mybatis.spring.boot</groupId>
</exclusion>
</exclusions>
</dependency>
<!--pinyin 4j-->

@ -55,6 +55,7 @@ import java.util.List;
*/
@Service
public class PmnPromotionSrcServiceImpl extends ServiceImpl<PmnPromotionSrcDOMapper, PmnPromotionSrc> implements IPmnPromotionSrcService {
@Autowired
private StoreEmployeeService storeEmployeeService;
@Autowired
@ -62,12 +63,8 @@ public class PmnPromotionSrcServiceImpl extends ServiceImpl<PmnPromotionSrcDOMap
@Autowired
private PoiStoreDOMapper poiStoreDOMapper;
@Autowired
private PrivilageCpUserDOMapper privilageCpUserDOMapper;
@Autowired
private IPmnActivityInstanceService pmnActivityInstanceService;
@Autowired
private PrivilageCpUserStoreDOMapper privilageCpUserStoreDOMapper;
@Autowired
private PrivilageUserDOMapper privilageUserDOMapper;
@Autowired
private PrivilageAccountService privilageAccountService;

@ -0,0 +1,62 @@
package com.kiisoo.ic.promotion.controller;
import com.kiisoo.ic.activity.entity.PmnPromotionSrc;
import com.kiisoo.ic.common.BaseController;
import com.kiisoo.ic.promotion.service.PromotionSrcService;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
/**
* @Description: 广c
* @Auther: yaoyao.zhu
* @Date: 2020/5/22
* @Version: v1
*/
@Controller
@RequestMapping("/promotion")
@Slf4j
@ApiModel("推广源管理")
public class PromotionSrcController extends BaseController {
@Autowired
private PromotionSrcService promotionSrcService;
@ApiModelProperty(value = "通过查询店铺推广导购信息", required = true)
@ApiImplicitParams({
@ApiImplicitParam(name = "instanceId", value = "活动id", dataType = "int", paramType = "form"),
@ApiImplicitParam(name = "storeId", value = "店铺id", dataType = "int", paramType = "form"),
@ApiImplicitParam(name = "pageNum", value = "页码", dataType = "int", paramType = "form"),
@ApiImplicitParam(name = "pageSize", value = "分页size", dataType = "int", paramType = "form"),
})
@RequestMapping(value = "/list/staff", method = RequestMethod.POST)
@ResponseBody
public Map<String, Object> staff(@RequestParam(value = "instanceId") Long instanceId,
@RequestParam(value = "storeId") Long storeId,
@RequestParam("pageNum") int pageNum,
@RequestParam("pageSize") int pageSize) {
try {
Map<String, Object> map = promotionSrcService.listStaff(instanceId, storeId, pageNum, pageSize);
return data(map);
} catch (Exception e) {
log.error("查询失败", e);
return fail();
}
}
}

@ -0,0 +1,27 @@
package com.kiisoo.ic.promotion.entity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
public class PmnPromotionSrcVO {
private String name;
private String staffCode;
private String mobile;
private String storeName;
private int type;
private String code;
/*
*
*/
@ApiModelProperty(value = "分页总条数", hidden = true)
private long totalSize;
/**序号*/
@ApiModelProperty(value = "序号", hidden = true)
private int number;
}

@ -0,0 +1,15 @@
package com.kiisoo.ic.promotion.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.kiisoo.ic.activity.entity.PmnPromotionSrc;
import com.kiisoo.ic.promotion.entity.PmnPromotionSrcVO;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import java.util.List;
@Repository
public interface PmnPromotionSrcMapper extends BaseMapper<PmnPromotionSrc> {
List<PmnPromotionSrcVO> queryList(@Param("instanceId") Long instanceId, @Param("storeId") Long storeId);
}

@ -0,0 +1,51 @@
package com.kiisoo.ic.promotion.service;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.kiisoo.ic.promotion.entity.PmnPromotionSrcVO;
import com.kiisoo.ic.promotion.mapper.PmnPromotionSrcMapper;
import com.kiisoo.ic.store.mapper.PoiStoreStaffDOMapper;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.atomic.AtomicInteger;
@Service
public class PromotionSrcService {
@Autowired
PmnPromotionSrcMapper pmnPromotionSrcMapper;
@Autowired
PoiStoreStaffDOMapper poiStoreStaffDOMapper;
public Map<String, Object> listStaff(Long instanceId, Long storeId, int pageNum, int pageSize) {
Map<String, Object> results = new HashMap<>();
PageHelper.startPage(pageNum, pageSize);
List<PmnPromotionSrcVO> pmnPromotionSrcList = pmnPromotionSrcMapper.queryList(instanceId, storeId);
if (CollectionUtils.isEmpty(pmnPromotionSrcList)) {
results.put("this", null);
return results;
}
AtomicInteger number = new AtomicInteger(1 + ((pageNum - 1) * pageSize));
//求分页总数
Page<PmnPromotionSrcVO> pageList = (Page<PmnPromotionSrcVO>) pmnPromotionSrcList;
Long totalSize = pageList.getTotal();
for (PmnPromotionSrcVO m : pmnPromotionSrcList) {
m.setTotalSize(totalSize);
m.setNumber(number.get());
number.incrementAndGet();
}
results.put("this", new PageInfo<>(pmnPromotionSrcList));
return results;
}
}

@ -8,7 +8,7 @@
spring:
profiles:
active: $profiles.active$
active: dev
mvc:
view:
prefix: /

@ -0,0 +1,18 @@
<?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.kiisoo.ic.promotion.mapper.PmnPromotionSrcMapper">
<!--拉黑-->
<select id="queryList" resultType="com.kiisoo.ic.promotion.entity.PmnPromotionSrcVO">
SELECT
c.name, b.staff_code, c.mobile,d.name store_name, b.type, a.code
FROM
pmn_promotion_src a
LEFT JOIN poi_store_staff b ON a.promoter_id = b.id
LEFT JOIN privilage_user c ON b.user_id = c.id
LEFT JOIN poi_store d ON b.store_id = d.id
WHERE
a.type = 1 AND b.store_id = #{storeId} and a.instance_id=#{instanceId}
</select>
</mapper>
Loading…
Cancel
Save