Commit 7a71e35e by 陶光胜

观云台小程序

parent e8c9b7d7
...@@ -7,7 +7,7 @@ import com.gic.cloud.dto.AttentionStoreDTO; ...@@ -7,7 +7,7 @@ import com.gic.cloud.dto.AttentionStoreDTO;
public interface StoreAttentionApiService { public interface StoreAttentionApiService {
ServiceResponse addStoreAttenttion(Integer userId, Integer enterpriseId, Integer storeId); 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); ServiceResponse<Page<AttentionStoreDTO>> pageStoreAttention(Integer userId, Integer enterpriseId, Integer pageNum, Integer pageSize);
} }
...@@ -4,6 +4,8 @@ import com.gic.cloud.entity.TabAttentionStore; ...@@ -4,6 +4,8 @@ import com.gic.cloud.entity.TabAttentionStore;
import com.github.pagehelper.Page; import com.github.pagehelper.Page;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface TabAttentionStoreMapper { public interface TabAttentionStoreMapper {
/** /**
* 根据主键删除 * 根据主键删除
...@@ -54,4 +56,8 @@ public interface TabAttentionStoreMapper { ...@@ -54,4 +56,8 @@ public interface TabAttentionStoreMapper {
int updateByPrimaryKey(TabAttentionStore record); int updateByPrimaryKey(TabAttentionStore record);
Page<TabAttentionStore> pageStoreAttention(@Param("userId") Integer userId, @Param("enterpriseId") Integer enterpriseId); 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; ...@@ -6,7 +6,7 @@ import com.github.pagehelper.Page;
public interface StoreAttenttionService { public interface StoreAttenttionService {
int addStoreAttenttion(TabAttentionStore tabAttentionStore); int addStoreAttenttion(TabAttentionStore tabAttentionStore);
int removeStoreAttenttion(Integer attentionId); int removeStoreAttenttion(Integer enterpriseId, Integer userId, String storeIds);
Page<TabAttentionStore> pageStoreAttention(Integer userId, Integer enterpriseId); Page<TabAttentionStore> pageStoreAttention(Integer userId, Integer enterpriseId);
} }
...@@ -7,7 +7,9 @@ import com.github.pagehelper.Page; ...@@ -7,7 +7,9 @@ import com.github.pagehelper.Page;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List;
@Service("storeAttenttionService") @Service("storeAttenttionService")
public class StoreAttentionServiceImpl implements StoreAttenttionService { public class StoreAttentionServiceImpl implements StoreAttenttionService {
...@@ -23,10 +25,13 @@ public class StoreAttentionServiceImpl implements StoreAttenttionService { ...@@ -23,10 +25,13 @@ public class StoreAttentionServiceImpl implements StoreAttenttionService {
} }
@Override @Override
public int removeStoreAttenttion(Integer attentionId) { public int removeStoreAttenttion(Integer enterpriseId, Integer userId, String storeIds) {
TabAttentionStore tabAttentionStore = this.tabAttentionStoreMapper.selectByPrimaryKey(attentionId); String[] split = storeIds.split(",");
tabAttentionStore.setStatus(0); List<Integer> list = new ArrayList<>();
int i = this.tabAttentionStoreMapper.updateByPrimaryKey(tabAttentionStore); for(String s : split){
list.add(Integer.valueOf(s));
}
int i = this.tabAttentionStoreMapper.removeAttention(userId, enterpriseId, list);
return i; return i;
} }
......
...@@ -28,8 +28,8 @@ public class StoreAttentionApiServiceImpl implements StoreAttentionApiService { ...@@ -28,8 +28,8 @@ public class StoreAttentionApiServiceImpl implements StoreAttentionApiService {
} }
@Override @Override
public ServiceResponse removeStoreAttenttion(Integer attentionId) { public ServiceResponse removeStoreAttenttion(Integer enterpriseId, Integer userId, String storeIds) {
this.storeAttenttionService.removeStoreAttenttion(attentionId); this.storeAttenttionService.removeStoreAttenttion(enterpriseId, userId, storeIds);
return ServiceResponse.success(); return ServiceResponse.success();
} }
......
...@@ -120,4 +120,15 @@ ...@@ -120,4 +120,15 @@
from tab_attention_store from tab_attention_store
where status = 1 and user_id = #{userId} and enterprise_id = #{enterpriseId} order by create_time desc where status = 1 and user_id = #{userId} and enterprise_id = #{enterpriseId} order by create_time desc
</select> </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> </mapper>
\ No newline at end of file
...@@ -30,8 +30,8 @@ public class StoreAttentionController { ...@@ -30,8 +30,8 @@ public class StoreAttentionController {
} }
@RequestMapping("remove-attention") @RequestMapping("remove-attention")
public RestResponse removeAttentiton(Integer attentionId){ public RestResponse removeAttentiton(Integer enterpriseId, Integer userId, String storeIds){
this.storeAttentionApiService.removeStoreAttenttion(attentionId); this.storeAttentionApiService.removeStoreAttenttion(enterpriseId, userId, storeIds);
return RestResponse.success(); return RestResponse.success();
} }
......
...@@ -4,13 +4,49 @@ import java.util.List; ...@@ -4,13 +4,49 @@ import java.util.List;
public class StoreGroupVo { 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() { public Integer getStoreGroupId() {
return items; return storeGroupId;
} }
public void setItems(List<StoreGroupItemsVo> items) { public void setStoreGroupId(Integer storeGroupId) {
this.items = items; 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