Commit 7a71e35e by 陶光胜

观云台小程序

parent e8c9b7d7
......@@ -7,7 +7,7 @@ import com.gic.cloud.dto.AttentionStoreDTO;
public interface StoreAttentionApiService {
ServiceResponse addStoreAttenttion(Integer userId, Integer enterpriseId, Integer storeId);
ServiceResponse removeStoreAttenttion(Integer attentionId);
ServiceResponse removeStoreAttenttion(Integer enterpriseId, Integer userId, String storeIds);
ServiceResponse<Page<AttentionStoreDTO>> pageStoreAttention(Integer userId, Integer enterpriseId, Integer pageNum, Integer pageSize);
}
......@@ -4,6 +4,8 @@ import com.gic.cloud.entity.TabAttentionStore;
import com.github.pagehelper.Page;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface TabAttentionStoreMapper {
/**
* 根据主键删除
......@@ -54,4 +56,8 @@ public interface TabAttentionStoreMapper {
int updateByPrimaryKey(TabAttentionStore record);
Page<TabAttentionStore> pageStoreAttention(@Param("userId") Integer userId, @Param("enterpriseId") Integer enterpriseId);
int removeAttention(@Param("userId") Integer userId,
@Param("enterpriseId") Integer enterpriseId,
@Param("storeIds")List<Integer> storeIds);
}
\ No newline at end of file
......@@ -6,7 +6,7 @@ import com.github.pagehelper.Page;
public interface StoreAttenttionService {
int addStoreAttenttion(TabAttentionStore tabAttentionStore);
int removeStoreAttenttion(Integer attentionId);
int removeStoreAttenttion(Integer enterpriseId, Integer userId, String storeIds);
Page<TabAttentionStore> pageStoreAttention(Integer userId, Integer enterpriseId);
}
......@@ -7,7 +7,9 @@ import com.github.pagehelper.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@Service("storeAttenttionService")
public class StoreAttentionServiceImpl implements StoreAttenttionService {
......@@ -23,10 +25,13 @@ public class StoreAttentionServiceImpl implements StoreAttenttionService {
}
@Override
public int removeStoreAttenttion(Integer attentionId) {
TabAttentionStore tabAttentionStore = this.tabAttentionStoreMapper.selectByPrimaryKey(attentionId);
tabAttentionStore.setStatus(0);
int i = this.tabAttentionStoreMapper.updateByPrimaryKey(tabAttentionStore);
public int removeStoreAttenttion(Integer enterpriseId, Integer userId, String storeIds) {
String[] split = storeIds.split(",");
List<Integer> list = new ArrayList<>();
for(String s : split){
list.add(Integer.valueOf(s));
}
int i = this.tabAttentionStoreMapper.removeAttention(userId, enterpriseId, list);
return i;
}
......
......@@ -28,8 +28,8 @@ public class StoreAttentionApiServiceImpl implements StoreAttentionApiService {
}
@Override
public ServiceResponse removeStoreAttenttion(Integer attentionId) {
this.storeAttenttionService.removeStoreAttenttion(attentionId);
public ServiceResponse removeStoreAttenttion(Integer enterpriseId, Integer userId, String storeIds) {
this.storeAttenttionService.removeStoreAttenttion(enterpriseId, userId, storeIds);
return ServiceResponse.success();
}
......
......@@ -120,4 +120,15 @@
from tab_attention_store
where status = 1 and user_id = #{userId} and enterprise_id = #{enterpriseId} order by create_time desc
</select>
<update id="removeAttention" >
update tab_attention_store
set status = 0
where enterprise_id = #{enterpriseId,jdbcType=INTEGER} and user_id= #{userId}
<if test="storeIds != null and storeIds.size()>0">
and store_id in
<foreach collection="storeIds" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</update>
</mapper>
\ No newline at end of file
......@@ -30,8 +30,8 @@ public class StoreAttentionController {
}
@RequestMapping("remove-attention")
public RestResponse removeAttentiton(Integer attentionId){
this.storeAttentionApiService.removeStoreAttenttion(attentionId);
public RestResponse removeAttentiton(Integer enterpriseId, Integer userId, String storeIds){
this.storeAttentionApiService.removeStoreAttenttion(enterpriseId, userId, storeIds);
return RestResponse.success();
}
......
......@@ -4,13 +4,49 @@ import java.util.List;
public class StoreGroupVo {
private List<StoreGroupItemsVo> items;
private Integer storeGroupId;
private String storeGroupName;
private Integer parentId;
private String idChain;
private String nameChain;
public List<StoreGroupItemsVo> getItems() {
return items;
public Integer getStoreGroupId() {
return storeGroupId;
}
public void setItems(List<StoreGroupItemsVo> items) {
this.items = items;
public void setStoreGroupId(Integer storeGroupId) {
this.storeGroupId = storeGroupId;
}
public String getStoreGroupName() {
return storeGroupName;
}
public void setStoreGroupName(String storeGroupName) {
this.storeGroupName = storeGroupName;
}
public Integer getParentId() {
return parentId;
}
public void setParentId(Integer parentId) {
this.parentId = parentId;
}
public String getIdChain() {
return idChain;
}
public void setIdChain(String idChain) {
this.idChain = idChain;
}
public String getNameChain() {
return nameChain;
}
public void setNameChain(String nameChain) {
this.nameChain = nameChain;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment